The first C language program learned

The first C language program learned
1. First open the compiler (VS2010) and click New Project


The first C language program learned
2. Choose visualc++ for template, empty project for project, name the project and find the location you want to store, click OK


The first C language program learned
3. Right-click the source file, select Add, and click New Item


The first C language program learned
4. Select visualc++ for the template, click on the c++ file, and name it xxx.c. Here I use project.c


The first C language program learned
5. Next, enter the first C language program you have learned, that is, print the sentence This is a C Program. (where int means plastic, main means main function, and the code will start to execute from the next line of main function). At this time, press Ctrl+F5 to let the program run, but found that a dark thing flashed by on the screen, but it did not display "This is a C Program."


The first C language program learned
6. When encountering the problem in 5, just right-click "project 0", click properties, and then select Connector-System-Subsystem, and select the console in the box on the right of the subsystem.


The first C language program learned
7. Then you can see "This is a C Program." printed on the screen.

As a beginner writing this type of things for the first time, I hope to point out the shortcomings.

Guess you like

Origin blog.51cto.com/15089430/2626013