/Hello World in C++ using Visual Studio 2015
Visual Studio 2015 Support | Visual Studio 2018-01-10T08:22:01+00:00

Visual Studio 2015 FAQ

Back to Support

How can we help?

Hello World in C++ using Visual Studio 2015

Thank you for downloading Visual Studio and start your first C++ journey!

  1. First, understand the layout and views once you launch Visual Studio 2015: create-new-project
  2. Next, review the standard build process for a Visual Studio project: VS 2015 build process
  3. Now, start building your first C++ project by choosing the project template. If C++ is not an already installed language in Visual Studio, you need to install Visual C++ 2015 Tools for Windows Desktop: Visual C++ 2015 Tool for Win Desktop
  4. After installing the Visual C++ 2015 Tools for Windows Desktop, you can choose the Win32 Console Application template and create your HelloWorld project: Win32 console application
  5. Click Finish to exit the Win32 Application Wizard Win32 Application Wizard
  6. You can see your first C++ project: C++ project
  7. Replace the code with below lines:
    #include "stdafx.h"
    #include <iostream> 
    using namespace std;    
        int main()      
            cout << "Hello World! ";    
            return 0;      
  8. Next, add a breakpoint by clicking the grey area in front of line 12: breakpoint
  9. Compile and run your project by clicking the green triangle in the tool bar (Local Windows Debugger) or press F5. Visual Studio allows single-click for build and debugging. Click Yes to build the project: build
  10. You can see a "Hello World!" in the console window. hello world
Troubleshooting: If the console window immediately closes, you need to set the breakpoint in step 8. If you are on Windows 8.1, you need to re-run the installer for Visual Studio, click modify, select languages, and choose C++.

Congratulations on your first C++ project! Please let us know whether you find this article useful or not. Thank you!

Back to Support