-
windows that closes
hello, i'm in the first tutorial c++ lesson. I probe the code of insert a number program. I'm using DevC++ compiler and it works cool. But after press enter key, for regonize the number it appears ant the window close maybe 1 second later.
So i introduce the comment "cin.get()" to mantain opened the window, as you say in the web , it doesn't work. The window close again.
COULD YOU EXPLAIN ME WHY? AND GIVE ME A SOLUTION, PLEASE.
THANKS!!!!
-
OS Dependant:
system( "pause" );
Compiler Dependant:
#include <conio.h>
cout << "Press any key to continue" << endl;
getch();
-
use system("pause");
were u want it to pause after that you just need to hit a key
to close the window
also #include <stdlib.h>