473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

i don't want the dos wondow be closed

hey guy !!

i m a beginer on C prog...i m using DEV-C IDE but when i m running a .EXE
the dos window open , run the .EXE and closed quickly, how could i do if i
don't want the dos window closed....what kind of code could i write at the
end ??
Nov 14 '05 #1
7 1566
#kiss# wrote:

hey guy !!

i m a beginer on C prog...i m using DEV-C IDE
but when i m running a .EXE
the dos window open , run the .EXE and closed quickly,
how could i do if i
don't want the dos window closed
....what kind of code could i write at the end ??


Find out where the compiler puts a.exe,
and then open a window there,
and then run a.exe from that window, instead of from the IDE.

--
pete
Nov 14 '05 #2
Did you try using getch() as the last statement of your main.

"pete" <pf*****@mindspring.com> wrote in message
news:40***********@mindspring.com...
#kiss# wrote:

hey guy !!

i m a beginer on C prog...i m using DEV-C IDE
but when i m running a .EXE
the dos window open , run the .EXE and closed quickly,
how could i do if i
don't want the dos window closed
....what kind of code could i write at the end ??


Find out where the compiler puts a.exe,
and then open a window there,
and then run a.exe from that window, instead of from the IDE.

--
pete

Nov 14 '05 #3
"Sreekanth" <sr*******@yahoo.com> wrote:

[Please don't top-post]
Did you try using getch() as the last statement of your main.
Since getch() is not a standard C function, use getchar() instead.
"pete" <pf*****@mindspring.com> wrote in message
news:40***********@mindspring.com...
#kiss# wrote:
>
> hey guy !!
>
> i m a beginer on C prog...i m using DEV-C IDE
> but when i m running a .EXE
> the dos window open , run the .EXE and closed quickly,
> how could i do if i
> don't want the dos window closed
> ....what kind of code could i write at the end ??


Find out where the compiler puts a.exe,
and then open a window there,
and then run a.exe from that window, instead of from the IDE.


--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #4
In <40***********************@news.free.fr> "#kiss#" <bi**@free.fr> writes:
i m a beginer on C prog...i m using DEV-C IDE but when i m running a .EXE
the dos window open , run the .EXE and closed quickly, how could i do if i
don't want the dos window closed....what kind of code could i write at the
end ??


Obviously, some code expecting you to press the Enter key before
continuing. Even as a beginner you should be able to figure it out.

Or, don't bother at all and keep a console window permanently open.
Rebuild the program from the IDE, but execute it from your console.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #5
"Irrwahn Grausewitz" <ir*******@freenet.de> wrote in message
news:dv********************************@4ax.com...
"Sreekanth" <sr*******@yahoo.com> wrote:

[Please don't top-post]
Did you try using getch() as the last statement of your main.


Since getch() is not a standard C function, use getchar() instead.


The OP will probably need two of them if they are reading input with scanf.

If the code only has one getchar call, it will typically swallow the newline left in the
stream and the program will exit immediately (closing the window) as before.

--
Peter
Nov 14 '05 #6
"Peter Nilsson" <ai***@acay.com.au> wrote:
"Irrwahn Grausewitz" <ir*******@freenet.de> wrote:
"Sreekanth" <sr*******@yahoo.com> wrote:
>Did you try using getch() as the last statement of your main.


Since getch() is not a standard C function, use getchar() instead.


The OP will probably need two of them if they are reading input with scanf.

If the code only has one getchar call, it will typically swallow the newline left in the
stream and the program will exit immediately (closing the window) as before.


Correct, but actually I use this as a test from time to time:
if the program didn't stop on the final getchar(), I know my
code failed to correctly consume all given input.

Regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #7
"Sreekanth" <sr*******@yahoo.com> wrote in message
news:c5**********@news.mch.sbs.de...
Did you try using getch() as the last statement of your main.

Or try
system("pause");
you need to include <stdlib.h>

HTH

--
Have a nice day

Remove (*dele*te) from email to reply
Nov 14 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
5
by: Brent Webster | last post by:
I have an asp page that is attached to database and I want to update the database when the window is closed. It is basically 5 text boxes wide by 8 text boxes high and these are all dynamically...
5
by: Matt Kruse | last post by:
See: http://www.mattkruse.com/temp/window_closed.html It looks like the .closed property of a window is inaccessible if the window is actually closed. Other browsers have no problem detecting...
1
by: Matt | last post by:
Hi everyone, I'm using the command mysqlcheck --all-databases --auto-repair --silent and I see these warnings (listed below) on a daily occurrence. Is mysqlcheck causing these warnings? I...
8
by: James Leddy | last post by:
Hello, I am making a program that encrypts and compresses plain text and indexes them by date. Needless to say, I have many alloc(), realloc(), calloc(), and free() calls. There are also...
4
by: #kiss# | last post by:
hey guy !! i m a beginer on C prog...i m using DEV-C IDE but when i m running a .EXE the dos window open , run the .EXE and closed quickly, how could i do if i don't want the dos window...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
21
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. ...
2
by: Bassem | last post by:
I'm working on simple chat program via serial port. It works fine, but i face this problem. When i try to open the exe, UnauthorizedAccess exception occurs, i can't use COM1 becuase someone else has...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.