Visual studio for c++

Hi,i just now downloaded visual studio community but however there is no win32 console application under visual c++.Instead there is visual c# and under it there is console application.Which software i have to install to use c++?can some provid eme the link...there are only enterprise,community and code softwares available but no ultimate software

If you used the installer defaults, you didn't install the things you wanted. Run the installer again and choose the custom install option, make sure you select anything having to do with C++.

Also, it is best to use "Empty project" when creating a C++ project, don't use the broken "Win32 Console Application" option.
That's what I always use. It's a good default.
Thank you guys..i ran a simple program but command window is closing immediately as soon as it runs executable file.how to avoid this?
See the second post in the topic stickied to the top of this forum:
http://www.cplusplus.com/forum/beginner/1988/
you need to pause
Add this.
1
2
cout << "Press enter to continue...";
cin.ignore();
Pretty much every possible solution, from the ingenious to the moronic, has been gone over in that thread. I don't think there's anything left to add that hasn't been said before.
closed account (E0p9LyTq)
Also, it is best to use "Empty project" when creating a C++ project, don't use the broken "Win32 Console Application" option.

What do you mean by broken? Please explain.

The "Win32 Console App" template in VS 2015 Community doesn't seem broken to me. Yes, the default settings add in a bunch of extra files that I don't want or need, such as the files needed for pre-compiled headers, but the template creates a viable console app that when run from the VS IDE keeps the console window open when the program ends. The C/C++ "Empty Project" template doesn't have that feature. Run it from the IDE and it closes as if it were run from the Windows shell.

The "Win32 Console App" template has a one page wizard where someone can select "Empty Project," which add no files to the project and still gives the project the ability to keep the console window open when run from the IDE.
Last edited on
Yes, the default settings add in a bunch of extra files that I don't want or need, such as the files needed for pre-compiled headers

That's broken enough for me.
+1 mutexe. It's broken because it's annoying to use.
The console is not staying open because you are most likely running it with a debugger and no breakpoints so the console window closes after execution, there is a ways to fix this though. It is basically to run it without the debugger attached (Which shouldn't be a problem in most cases).

1) The most preferred option in my opinion is to just run your program inside VS by pressing CTRL-F5 instead of just F5. This will now keep the console open with a "Press any key to continue . . ." message when the program execution exits.

For this solution to work, you need to make sure you have the Console linker option selected "Console (/SUBSYSTEM:CONSOLE)". You can check this by following these steps.

1.Open up your project, and go to the Solution Explorer. 

2.Right click on your project in the Solution Explorer.

3.Choose "Properties" from the context menu.

4.Choose Configuration Properties>Linker>System.

5.For the "Subsystem" property in the right-hand pane, click the drop-down box in the right hand column.

6.Choose "Console (/SUBSYSTEM:CONSOLE)"

7.Click Apply


After that it should work perfectly for you. Though be warned again this will run the program without the debugger. If you do want to be using the debugger and also want the console to stay open when execution of your program is done you can run it normally with F5 and then just set a breakpoint at the return statement inside of your main() function.

Otherwise you can always go down the route others have mentioned with adding lines of code to your project to keep the console open. Hope this helps.
Last edited on
closed account (E0p9LyTq)
The console is not staying open because you are most likely running it with a debugger

I was running using CTR+F5, I simply didn't know what the project/solution option was for the system linker. Now I know.

I personally still find it easier use the Win32 Console template and then specify an empty project from the settings wizard page.
Topic archived. No new replies allowed.