Visual C++ 2008 Question

Joined
5/7/08
Messages
19
Points
11
Hey guys

Have somewhat of a silly question about Visual C++ 2008...whenever I compile and run a program, the output window just pops up and closes right away. I can get around it by creating a breakpoint at the last line in my code, but having to do that every time is somewhat of a pain in the butt.

Is there a way I can configure it so that Output window stays open until I close it or I "press any key to continue."

And just out of curiosity, what IDE is most commonly in the industry? I use Ubuntu, so for the most part I use Code Blocks. But I recently started fiddling around with Visual Studio and this Output window thing has been annoying me.
 
This might not be the most elegant solution but you could just put

cin >> some_variable;

At the end of you code. It will hold the window open until you type something and hit enter.

Jeff
 
I've been alternating between that and the breakpoint, but I was hoping for a setting/option that would take care of it.

If not, then I'll just probably just go with the 'cin >> variable;' method. Thanks anyway.
 
Put

cout << endl;
system("PAUSE");

before

return 0;

It should work for you.
 
Back
Top Bottom