C Language Knowledge points

Source: Internet
Author: User

Basic structure of C program
C programs are composed of functions.

Each program consists of one or more functions, which must have only one main function, main ().

The main function is an entry and normal exit for an executable C language program, regardless of where it is written throughout the program.

In the C language, uppercase and lowercase letters are different. (for example, it is customary to use lowercase letters to define variables and to define constants in uppercase letters).

C Program comments have two methods, one is the line comment, the use of "//", and the other is a block comment, using "/* */", note "/*" and "* *" cannot be nested use.

C language Writing is more flexible, but promote the use of indentation format for program writing, to reflect the level of the sentence between the sense. C program Each statement with a "semicolon" as the end flag. You must not use semicolons in the following situations:
(1) A semicolon must not be used after the defined function name;
(2) If...else ... The statement is a whole and cannot be separated by a semicolon in the middle;

(3) cannot use semicolon after precompiled command

C Program Development Steps
C language on the computer development process is mainly composed of the following four steps:

?? First step: Edit. Generate a source file with the suffix named ". C"

?? Step two: Compile. Generate a target file with the suffix named ". obj"

?? Step three: Connect. Generate an executable with the suffix named ". exe"?? Fourth step: Run.
3, the use of vc++6.0 development tools
Press function key CTRL+F7 compile program, press function key F7 Connect program, press function key CTRL+F5 run program;
Syntax errors during compilation and connection, press the function key F4 to locate the wrong line and correct the error based on the error message (the principle is to resolve errors first, then resolve warning).
4. Naming rules for identifiers in C language
Identifiers consist of letters, numbers, underscores, and the first character must be a letter or an underscore.
Identifier definition of the variable name, function name, constant name, etc. best to do "see the meaning of"; capitalization means different meanings; you cannot use keywords; it is best not to have the same name as a C-language library function.

C Language Knowledge points

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.