Have dos box not "Close on exit" when console app terminates
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
Say i have a C program that produces some kind of
output then terminates, i go compile and run (F9), and
the dos box closes immediately after the program
terminates, thus i can't see what the ouput was.
A prompt like "press any key to close" would be good,
like in Visual Studio.
Logged In: YES
user_id=1127202
Thats not a Dev-C++, but rather a C problem.
You can get this "press any key to close" by adding
'system("pause");' of 'getchar(); ( both without the ') at
the end of your programm, which is exactly what Visual
Studio does.
Logged In: YES
user_id=828749
I don't agree with the comment by kaptain_nemo. We don't
want to pause the app on the end. We only want to see
console app output. This could be easily implemented using
e.g. batch file.
Logged In: YES
user_id=1131858
Agreed. You should be able to press shift or ctrl plus F9 in
order to compile and run, but not terminate the program,
just like in MS Visual Studio.
Logged In: NO
I like the feature in lcc-win32. When you use compile->run it
runs your program and then displays the execution time, return
code, and then has a pause statement with press any key to
continue. This way the program pauses to view output and
you get other important information.
Logged In: YES
user_id=735003
This is a defect in the library 'exit', 'abort' or setup
code. If you want to fix it in the setup code, you need to
post an 'onexit' callback. In any case, someplace in the
normal exit sequence you need to do:
common... /
puts( "Push any key to exit."); / Translate per
locale? */
getchar();
}
The main problem with this is that it screws up if someone
does a 'reopen' on stdin and to a lesser extent on stdout.
That is the main reason for doing something in the setup
code. If you check before the application has a chance to
do a 'reopen' and somehow cache handles for stdin and stdout
for later use, you can ignore what the application does to
stdin and stdout.
Logged In: NO
yes please asap!!!!!!!!