The main issue I have with Visual Studio is the lack of intuition it possesses when creating simple command line programs.
First to create a new console application:
File > New > Project >Visual C++ > Win32 > Console Application
YOUR CODE HERE!
Here is where things get annoying:
Your program will eventually return so you have a few options to keep the console window open long enough to view the output.
My personal choice:
Use Ctrl+F5 with the
Console (/SUBSYSTEM:CONSOLE) linker option enabled.
This option is available as follows:
Solution Explorer > Right click Project > Properties > Configuration Properties > Linker > System > Subsystem
You will see “Press any key to continue . . .” before the window terminates.
insert cin.get() before the return statement on all console applications.
cin.get(); return 0;
This method will wait for user input, albeit, with less verbosity.