Everyday i make a program in c++ (simple ones, I just started learning)....say for example a Hello World program, when I run it, the console window only shows up for about a second, and then the program ends....
How can I make it stay open?
Printable View
Everyday i make a program in c++ (simple ones, I just started learning)....say for example a Hello World program, when I run it, the console window only shows up for about a second, and then the program ends....
How can I make it stay open?
don't make simple ones :p
Actually, i use to press ctrl+f5 to compile and it ask me to press any key to continue. Otherway you could always use cin ;)
cin makes your program stay open until something is entered
PHP Code:char cBuff[256];
cout << "Enter comething to Quit!\n";
cin >> cBuff;