<< Dark Horse programmer >> Keywords, identifiers and annotations for C language

Source: Internet
Author: User

Keywords for C language

A total of 32 keywords are available in the C language :

Features: ①c language keywords are all lowercase letters.

② keywords in the development tool or Smart text Editing tool will display a special color font, by default, the C keyword in Xcode will show the purple-brown.

The key words of C language are: int, return.

C-language identifiers

1 What are identifiers

C language identifier is in the program to customize some of the symbols and names, to be separated from our keywords, the keyword is the C language provided by the symbol, the identifier is the programmer's own definition.

2 naming rules for identifiers (must be followed)

① can only be composed of 26 English letters, 10 Arabic numerals and underscores;

② are strictly case-sensitive, such as test and test are two different identifiers;

③ cannot begin with a number;

④ can not use keywords as identifiers;

3 Naming conventions for identifiers

① try to make a meaningful name for the identifier, you can use an English word, or you can use pinyin.

② If there are more than one word in the identifier, you can use the hump flag to capitalize the first letter of each word except for the first letter.

Comments

1 What is a comment

Annotations are important in a program, and annotations can explain the meaning of a program and a line of code, which can be any word, number, or word.

2 Single-line comment

① adds two to the front of each line of comments//To comment all explanations behind the slash.

② can write notes anywhere.

3 Multi-line comments

Multiline comments start with/*, end with */, the contents of/* and/* are commented

4 Nested behavior of annotations.

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

② Multiline comments can nest single-line comments .

③ Multiline comments cannot nest multiple lines of comments .

<< Dark Horse programmer >> Keywords, identifiers and annotations for C language

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.