Starting a New Project
Because Visual Studio is a professional tool for writing large programs, there is a bit of setup required each time you want to work on a new program: a “project” must be created. The following steps for creating a project may seem overly complicated for the programs we will be writing in this class, but the process will become familiar with practice. (These instructions are for Visual Studio 2022. If you are using an earlier version, the process is similar but the interface may be slightly different — check with the instructor if you run into problems.)
Upon starting Visual Studio:
- You should see the “Get started” dialog box; click the “Create a new project” button.
(If you do not see the “Get started” dialog, select “New > Project…” from the File menu.)

The “Create a new project” dialog box will appear. Choose the “Empty Project” template from the list and click “Next”. (The correct template option will have the description “Start from scratch with C++ for Windows. Provides no starting files.” If you do not see this template option, use the filters at the top of the dialog box to search for Language: “C++”, Platform: “Windows”, and Project type: “Console”.)

Note: If you find that you can't create a C++ project, you may not have installed the compiler during the installation process. From the “Create a new project” dialog, scroll all the way down the list of project types and click on the link that says “Install more tools and features”. Select the item labeled “Desktop development with C++” (see Installation Notes), then click the “Modify” button. You should then be good to go!

- The “Configure your new project” dialog box will appear; you can accept the default project name and location, or change these to your liking.
Click “Create” to create the project.

- Your project is ready to go!
The Solution Explorer window should appear on the right side of the window.
(If it does not, select “Solution Explorer” from the View menu.)

You now have to create a file where you can type your source code:
- Right-click on the “Source Files” folder in the Solution Explorer window; a menu will appear.
Select “Add > New item…”

- The Add New Item dialog box will appear.
(If you see a tiny little dialog box with only enough room to type a filename, click the “Show All Templates” button.)
Verify that you are creating a “C++ File (.cpp)” (choose this option if it is not already selected by default).
Give your file an appropriate name (with a
.cppextension) and change the location so that the file is saved on the Desktop or some other convenient location, then click “Add”. If you forget to change the location, your source code file will be saved in the project directory and you will then need to hunt for it!
- You are now ready to start typing your source code!

You'll repeat these steps every time you want to create a new program.