Possible Duplicate:
C++ beginner, execution window disappears quickly
I am beginner at C programming. But when I compile the programm, a problem occurs. The compiler create a .exe for the program, but when I open it, it appears and disappears in a second.
This error can be stopped by adding
SYSTEM("PAUSE");
at end of the program. But it will create a
press any key to continue
at the end of program. What is the error of mine? Why the program appears and disappears in a hurry?
How do I stop it without adding the system() function? I’m using the GCC compiler.
That isn’t an error. The program will terminate after finishing the code you programmed. If you want to input something try
scanffor instance.