Hello guys,

Does anyone know how to keep a console window active till the user presses any key on the keyboard to close the console? Everytime I create a program on devcpp, when I run it the console window just doesn't stay there, it disappears within seconds. I knew how to do this with an older version of devcpp, but since I've upgraded it, I haven't really used it much. Now I want to start with some 2d gaming programs.

Ronica

have you tried

system("pause") ;

?

have you tried

system("pause") ;

?

:O
You could have at least gave a platform independant solution!

cin.get();

oreven better yet, run your commandline program from the commandline/termianl xD

Chris

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.