Li Hongqiang-C language keywords, identifiers, and annotations

Source: Internet
Author: User

First, the key word

C language provides a special meaning of the symbols, a total of 32.

Keywords are all highlighted in Xcode and all keywords are lowercase. such as return, int, and so on.

Second, identifiers

Definition: Identifiers are some of the symbols and names that programmers customize in a program. Keywords are system-brought, and identifiers are custom-defined. such as the name of a function, to distinguish between various transactions.

Identifiers have certain naming conventions:

    • Can only consist of 26 lowercase letters, 0-9 digits, and an underscore.
    • Strictly case-sensitive.
    • Cannot start with a number.
    • You cannot use a keyword as an identifier.

It is recommended to follow the naming conventions:

(1) Try to make a meaningful name;

(2) Multiple words can be connected using the hump marker (the first letter of the second letter) or using an underscore.

Third, comments

(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.

Li Hongqiang-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.