Creating a simple program in Microsoft Visual Studio 2015

Today we used Visual Studio 2015 to write and execute a simple C++ program. The steps are essentially:

  1. Have access to Visual Studio 2015. We didn't need to worry about this today because we were in the PIC lab, where VS2015 is already set up. (We just needed to be careful not to accidentally use VS2013 instead.) To work on your own home computer, you probably want to download the free Community Edition of VS2015.
  2. Create a new project, add a .cpp file for code, type a program, build the project, and run your program! Really these are all separate steps, but I'm listing them together because this tutorial should help if you forget how to do any of these things. It's technically meant for VS2012 but that shouldn't matter for this example.

My program won't build!

If the Build step gives an error message, you may have a mistake in your code OR you may have made a mistake during the creation of the project. Make sure that you create an empty project. To see if your project is empty, check your Source Files and Header Files in the solution explorer. The only thing there should be the HelloWorld.cpp that you created yourself.

More cool stuff to try: