MSVC

Projects

The first step for programming C with MSVC is to create a project. This basically is a folder which contains all the source code of the project.

Multiple projects can be grouped into a so called solution, but there is only one program generated per project.

To open an existing project, double click on the corresponding project or solution file.

To create a new empty project, choose the menu entry File→New→Project. In the dialog, choose C++ as project type and give the project folder a name and location (for example on the Desktop). Be sure to create a win32 console application and an empty project!

To add a new empty source file to the project, right click at the Source Files entry of the project tree view on the right window side and choose Add→New Item from the context menu. In the dialog, choose C++ Code as the file type and enter the name of the file.

As an example, add a source file named hello.c to the project tree view. Double click on it to open it in the editor on the right side. Then paste the source code of the hello world program into the editor as given below:

#include <stdio.h>

int main()
{
   printf("hello, world!!!\n");

   return(0);
}


Intro | | Compilation

Options: