Very dumb C++ programming questions.

  • Thread starter Thread starter FEnzo
  • Start date Start date
Joined
10/17/10
Messages
74
Points
268
So I just started learning C++ and tried a few programs myself.
I was using Xcode on mac, which is so user friendly, and everything was fine.
Then I start programming on my laptop using visual studio, everything went alright, but my question is every time the program done running, it just shuts off, and since I am running some very basic programs, I can only see a black command window flashes once. On the mac, the command windows will just stay on the screen.
Any thoughts as to how to make the cmd window stay??
Thanks!!!
 
Just add some code at the end of your main() that will wait for input, i.e. cin.get()
 
1) Try Ctrl+F5 to run without debug
2) Try to put std::cin.get(); before return 0; line
EDIT: APalley is faster. Arggg. But mine is more failsafe since it does not assume the OP has declared
PHP:
#include<iostream>
 
Back
Top Bottom