+ 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

1st May 2019, 7:55 AM
zahra kazemi
6 Respostas
+ 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.
1st May 2019, 8:32 AM
sneeze
sneeze - avatar
+ 2
I used control+f5 to execute my code, but I cant see the result it disappeare very fast
1st May 2019, 10:59 AM
zahra kazemi
+ 2
First clear this for me You are talking about visual studio code or visual studio IDE
1st May 2019, 2:28 PM
Bug Slayer
+ 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++)
1st May 2019, 7:14 PM
sneeze
sneeze - avatar
+ 1
Use cin.get () as last line of the main function or you can use system ("pause"); on windows
8th May 2019, 5:53 AM
Mohd Zeeshan Aareef
Mohd Zeeshan Aareef - avatar
0
Hilo
2nd May 2019, 7:32 AM
حیدر عظیمی
حیدر عظیمی - avatar