the window with cout dissapears instantly. I have looked a ton about this problem and the common answer is to press ctrl-F5 or run without debugging. I have tried this and all I get is a red checkmark in the selected line. Even worse, F5 is my browser key so if I miss ctrl I start up the browser. I have been looking for other keys to do this, and the only thing I've found is the shortcut configurer, but it doesn't have the right configurations. The only thing that helps, is adding
int choose;
and
cin >> choose;.
I know what it means.
I don't want to add that to every program, so I want to find another way.
I want to get that to work ASAP.
thanks
It's the second post from the top of this forum, outlined in bold black, called "Console Closing Down". If you can't find it, then you shouldn't be using the internet ;)
You have to use some statement to simulate a pause -if you don't want to run it from the console- Windows .-.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
//You can use "using namespace std;" instead of..
int main(){
//print output + new line
cout<<"Hello World!"<<endl;
cin.ignore(); //pause
return 0; //indicate successful termination
}//end main