C++ Compiling and Building Compiling with Visual Studio (Graphical Interface) - Hello World


Example

  1. Download and install Visual Studio Community 2015
  2. Open Visual Studio Community
  3. Click File -> New -> Project enter image description here
  4. Click Templates -> Visual C++ -> Win32 Console Application and then name the project MyFirstProgram. enter image description here
  5. Click Ok
  6. Click Next in the following window. enter image description here
  7. Check the Empty project box and then click Finish: enter image description here
  8. Right click on folder Source File then -> Add --> New Item : enter image description here
  9. Select C++ File and name the file main.cpp, then click Add: enter image description here 10: Copy and paste the following code in the new file main.cpp:
#include <iostream>

int main()
{
    std::cout << "Hello World!\n";
    return 0;
}

You environment should look like: enter image description here

  1. Click Debug -> Start Without Debugging (or press ctrl + F5) :

enter image description here

  1. Done. You should get the following console output : enter image description here