+ 2
Does anybody use Visual Studio?
I am buildig the basic "Hello world!" program, and I have no errors on my build, but I cannot see the output. A window flashes on and off when i run it, which I assume is where "Hello World" is printed, but how do I make it stay on screen so I can see it? i think thia must be a settings issue. Thank you
6 Réponses
+ 9
The recommended way to halt output window from exiting is to add getchar() before return 0.
+ 3
At the end of your program, you can add these two lines (in your main() function):
cout << "Press any key to continue..." << endl;
cin.get()
+ 2
Or before "return 0;" write: std::system("pause>nul");
+ 2
@Jakub
I will have to try that soon
+ 1
or you can assign a variable(like I) at the top of the main function and then go to main function and on last line write
cout << I;
0
I use, but I have problems when I need to erase a line.