• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

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