Writing First C++ Program in Microsoft Visual C++ : Hello World Example

Introduction to Microsoft Visual Studio by writing Hello World Program in C++

Open Visual C++ or (Visual Studio 2017 as in screen shots)

  1. On the menu bar, choose File --> New --> Project. untitled

  2. In the Visual C++ category, choose the General --> Empty Project template.

  3. Enter a valid name in the Name field like GreetingsApp and click OK. untitled

  4. In the Solution Explorer panel, right click Source Files, select Add --> New Item. untitled

  5. In the Add new item dialog, click on Code. Under Templates click on C++ File(.cpp)

  6. Enter a name for the newly created file like Greetings.cpp and click Add. untitled

  7. A blank editor window will be displayed. Type in the following code: untitled

  8. Press Ctrl+Shift+B to build the project. Alternatively, select Build Solution from the Build menu. The build progess will appear in the Output window. untitled

  9. If there are no errors, select Start without debugging from the Debug menu to run the file or press Ctrl+F5. untitled

Hello World! will appear in the console.

Congratulations you’ve just created you first VC++ application.