Dev-C++ Issue: DOS Window closes way too fast.

CKTurbo128

Platinum Member
May 8, 2002
2,702
1
81
I'm not sure if this goes in OS or this forum, as it relates to both. Anyhow, this is somewhat embarrassing to ask, but in Windows XP Pro., how do you change DOS execution options? I'm currently using Dev-C++ to code some simple C++ programs and does output through DOS. However, the DOS window closes immediately after the DOS program finishes executing, so I can't see any of the errors or outputs generated from my program. Is there a way to keep DOS windows open even after exeuction has finished?
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
You can launch you program from the command prompt (Start Menu -> Accessories -> Command Prompt) or add (I think) getchar() at the end of your program so that it waits for a keystroke before closing.
 

klah

Diamond Member
Aug 13, 2002
7,070
1
0
Doesn't the default example in Dev-C++ end with:

system("PAUSE");

?
 

BFG10K

Lifer
Aug 14, 2000
22,709
3,005
126
An IDE usually adds a "press any key to continue" if you launch the program through it.