#include <stdio.h>int main () { printf ("hello world!\n") ; GetChar (); // here to avoid the completion of the program automatically exit return 0;}
Steps:
The first step is to create a new project, which is a bit more cumbersome than programming under Linux. Click "New Project" and select "Visual C + +"-"Win32" on the left side of the pop-up window and select Win32 Console application on the right.
The second step, at this time, enter "HelloWorld" in the Name field, create a new project called "HelloWorld", click Confirm directly, this will automatically generate Helloworld.cpp and corresponding header file. Click Next and put the additional option "empty Project" before hitting "√" so that an empty project is created.
In the third step, in the Explorer on the right, right-click in the Source Files folder and choose Add-New item. At this point, we create a source file called "Helloworld.cpp", click Add.
Fourth step, you can see a file named "Helloworld.cpp" in the list of source files, and the system opens the newly created file. Next, we write a simple HelloWorld program, click Save.
#include <stdio.h>
int main () {
printf ("Hello world!\n");
GetChar (); Here to avoid the completion of the program automatically exit return 0;
}
VS2010 Getting Started Program