Help with Dev-c++

Thread Starter


Joined Nov 9, 2007
I just finished writing a program in C using Dec-c++, but when I compile and run the window opens and closes before I can use the program. Is there anything I can do to keep the window open?


Joined Dec 23, 2006
I forgot the exact name of the command since I haven't used C in forever, but use a command that asks for an input at the end. That will pause the program before it closes.


Joined Dec 1, 2007
Salgat is correct. When running c++ programs in the Windows environment, the program runs fine and closes when it is complete. Adding a simple cin>> statement to a variable at the end will pause the program until you enter a value. This will allow you to see any other output from your program as long as you like.


Joined Apr 27, 2007
You can also run you console program from the command line. Just put a batch file containing the line "cmd.exe" (or "" if you are using Windows 95/98) in the same folder of the compiled executable. Thus you can test your program without alterations.

Dev-C++ is a great compiler. I think it uses the same assembler as DJGPP (GCC - GNU Compiler Colection).