C language keywords, identifiers and annotations

Source: Internet
Author: User

First, the key words:

The keyword is a word that has been used by the C language itself and cannot be used for other purposes. For example, a keyword cannot be used as a variable name, function name, etc.

c keyword Total 32 keywords, such as the common int struct break enum and so on

Keywords are divided into two main categories: one is the data type keyword, the other is the Process Control statement key word

For example:

Two, the indicator

Identifiers are used to identify the names of an object in the source program, which can be statements, data types, functions, variables, constants, arrays, and so on.

Naming rules for identifiers (laws that must be followed): only letters, numbers, underscores, or $ symbols, and can only start with a letter or underscore, and you cannot use keywords as identifiers.

  Naming conventions for identifiers: 1> a meaningful name for future reading and maintenance

2> Hump nomenclature ( Hump nomenclature is a unique identifier that is formed when a variable name or function name is linked together by one or more words, and the first word starts with a lowercase letter,

Capitalize the first letter of two words, or the first letter of each word in uppercase letters)

Third, note

(1) Note to explain the meaning of the code, improve the readability of the program, the comments out of the content will not participate in the compilation. Notes are written for programmers to see and facilitate communication between colleagues.

(2) Symbols for annotations

    • Single-line comment//
    • Multiline Comment/* */

(3) You can use annotations to check the function of the code (before and after the control), you can use comments to debug (because the compiler error is sometimes inaccurate, and an error often raises multiple errors)

(4) Nesting of annotations

①. Single-line comments can nest single-line comments, multiline comments

②. Multiline comments can nest single-line comments

③. Multiline comments can not nest multiple lines of comments

(5) Pay attention to printf ("//abc"); here//in double quotation marks is part of a string rather than a comment.

  

C language keywords, identifiers and annotations

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.