ms-dos "like" windows won't stay open

stickybytes

Golden Member
Sep 3, 2003
1,043
0
0
im trying to execute the programs that i have written using dev c++ but the ms-dos "like" windows (black background, white letters) just stay open for one second and then disappear. is there anyway to make windows stop doing that?

i understand there is no more ms-dos in win xp but the windows look like ms-dos.
 

WobbleWobble

Diamond Member
Jun 29, 2001
4,867
1
0
Easiest way is to add a getch() or something to the end of your program unless there's an option in DevC++ to keep that window open.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
^ yep, add code to pause the program before it ends.

Console apps closing on completion is "by design," just like the windows for any other app close when you end them.
 

illusion88

Lifer
Oct 2, 2001
13,164
3
81
not to bring a thread back from the dead (sorry I was seaching for something and this cought my eye) but you could also do a system("pause") right before your return 0. That would leave the window up saying "press any key to continue..."