+ 3
Visual studio setting
Hi is anyboy here that works with visual studio? My code dont run, it has just compiled, black page has appeared and it disappear undoubtedly
6 Réponses
+ 4
In visual studio run your code with ctrl-F5 or add an extra Console.ReadLine at the end of the code.
Your code has run, but also closed before you could see the results.
+ 2
I used control+f5 to execute my code, but I cant see the result it disappeare very fast
+ 2
First clear this for me
You are talking about visual studio code or visual studio IDE
+ 1
if control f5 is not working, have a look at the following video.
https://www.youtube.com/watch?v=F82W3pv87Hk
There is a visual studio setting which need to be set.
quote :
Please right click your project name and go to Properties page, please expand Configuration Properties -> Linker -> System, please select Console (/SUBSYSTEM:CONSOLE) in SubSystem dropdown. Because, by default, the Empty project does not specify it.
https://stackoverflow.com/questions/2529617/how-to-stop-c-console-application-from-exiting-immediately
If all above does not work. Add one of the following lines just before return; (last line of you code)
system("pause");
And of course not Console.ReadLine (c#) but cin.get(); (C++)
+ 1
Use
cin.get ()
as last line of the main function
or
you can use
system ("pause");
on windows
0
Hilo