+ 6

[SOLVED] Help with Visual Studio output

whenever I run a C++ program on Visual Studio. up pops up a little black window that shows the output for a less than a second how can I extend this time, or have it show in the little console at the bottom of my screen?

6th Sep 2018, 7:59 PM
LONGTIE👔
LONGTIE👔 - avatar
7 Réponses
+ 7
Place cin.get(); at the end of your code. It makes the console application wait for a input. Run it with ctrl-F5
6th Sep 2018, 8:27 PM
sneeze
sneeze - avatar
+ 5
sneeze why ctrl-f5? just f5 works btw thank you both for the answers.
6th Sep 2018, 8:34 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 5
F5 works but does not hold the console window. So after all statements are executed the console window will disspear before you can view the output. Ctrl -F5 works and hold the console window, so you can see the output.
6th Sep 2018, 8:38 PM
sneeze
sneeze - avatar
+ 5
Ok thanks sneeze
6th Sep 2018, 8:38 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 2
Im dont know c++ but probably you should write cin.get() or system("pause") or using C functions like getch()or getchar()?
6th Sep 2018, 8:16 PM
Ilias
Ilias - avatar
+ 1
its may be cuz u dont hit crtl-s
7th Sep 2018, 6:57 PM
Potato Hacker
Potato Hacker - avatar
0
both ctrl +5
7th Sep 2018, 9:38 AM
Цогоо
Цогоо - avatar