Compile a pure C language program in Visual Studio

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.