Advertisement

Dev-C++ Compiler

Started by October 07, 2002 10:00 PM
4 comments, last by krazkidd2000 22 years, 1 month ago
I recently got the free Dev-C++ Compiler, and I need to know how to keep the console window open (the DOS window). Does anyone know where I can set that up?
In descending order of preference

a) The Right Way - open a dos console and run your program from it : a console program needs a console to run in.
b) right click on the program icon, choose properties, ''Program'' tab, uncheck "close on exit"
c) non-portable : add system("pause"); in your code
d) non-portable : add getch(); in your code

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
Thanks, but I don''t fully understand the "b" part of your answer, could someone explain it more thoroughly.
add this
#include <stdlib.h>

and this, right before return 0;

system ("PAUSE");

Beginner in Game Development?  Read here. And read here.

 

quote: Original post by krazkidd2000
Thanks, but I don''t fully understand the "b" part of your answer, could someone explain it more thoroughly.


In Windows, as with any other file, the program you just created with the compiler has an icon representing it, allowing you to manipulate it through the the GUI. Doing the indicated manipulation tells the operating system not to close the console once the program has terminated.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
THANKS DUDES!!!

This topic is closed to new replies.

Advertisement