Using Visual C++

Creating projects

All programs are created as projects. Typically, you should have a project for each problem i.e. at least one for each assignment.

Adding files

Now that you have created a project, you can go about writing the program. Programs are created by writing code in files. You can now type some code in the file you just created.

Compiling the project

To compile(build) the project, press the F7 key. You can also do this from the "Build" menu, or from a button on the toolbar. Find out how you will do this.

Running the program

If there are no compilation errors in the Build window at the bottom, you can execute the program by pressing the Ctrl and F5 keys simultaneously. You can also press the red exclamation button on the toolbar, or by selecting Build -> Execute.

Inserting and Deleting Projects

You can insert new or existing projects into your project workspace, and delete existing projects from the workspace. You can also delete specific configurations for a project without removing the entire project.

What do you want to do?

Insert a new project into an existing workspace

Add an existing project to the workspace

Delete a project from a workspace

To insert a new project into an existing project workspace

  1. Open the project workspace to which you want to add a new project.

  2. On the File menu, click New and then click the Projects tab.

  3. Select the project type.

  4. Specify the Project Name and Location for the project.

  5. Click Add to Current Workspace.

  6. Select any of the available platforms for which you want to create initial Debug and Release configurations.

  7. Click OK.

The new project that you just created becomes the default project in the workspace.

To add an existing project to a project workspace

  1. Open the project workspace to which you want to add a project.

  2. On the Project menu, click Insert Project into Workspace.

  3. In the Insert Projects into Workspace dialog box, browse to locate the project you want to add.

To delete a project from the workspace

Setting the Active Project

The active project is the project that will be built when you use the Build or Rebuild All commands.

To set the active project