This articleArticleDescribes how to use Microsoft Visual Studio to write pure C LanguageProgramHere, the pure C language refers to the ansi c language.
To create an ansi c program in Visual Studio, follow these steps:
1. Start Visual Studio
2. Select File> New> project to enter the new project dialog box, for example:
3. In project types (project type), select visual c ++
4. Select Win32 Project (Win32 project) in templates (Template)
5. In the Name text box, write the name of the project, such as firstapplication.
6. Select the Save path of the project in the location text box, such as C:/test. Click OK ). Click OK to enter the Win32 Application Wizard (Win32 Application Wizard) dialog box. For example:
Select application settings on the left to enter the application Settings dialog box, for example:
7. In application type, select console application)
8. In additional options (additional options), select Empty Project (Empty Project)
9. Click Finish)
10. In Solution Explorer, right-click the source files directory, select add, and select Add new item)
11. In the Add new item-firstapplication dialog box, click C ++ file (. cpp) of templates (Template), for example:
12. In the Name text box, write the file name, such as test. C. Use. C as the file extension. Click Add)
13. In test. CCodeAnd paste the following code:
# Include <stdio. h>
Int main ()
{
Printf ("Hello World/N ");
Return 0;
}
14. Select build solution from the build menu)
15. Press Ctrl + F5 to run the program, and the Command Prompt window will pop out. The window displays the following content:
Hello World
Press any key to continue
Follow these steps to write a C language program in the Visual Studio environment.
This article is translated from Microsoft's knowledge article "How to Write ansi c programs by using Visual C ++. Net or visual C ++ 2005 ". This article uses the Visual Studio 2008 interface.