IOS Study Notes: (2) c language-2.3 identifier

Source: Internet
Author: User

IOS Study Notes: (2) c language-2.3 identifier

1. What is an identifier is some of the symbols and names customized in the program. To distinguish it from keywords: keywords are the default symbols provided by C language, and identifiers are customized by programmers. identifier 1) identifier, literally used to identify something, the purpose of the identifier is to distinguish these things 2) Actually, identifiers serve almost the same purpose as human names. To distinguish each person, a name is given at the time of birth. 3) C language is composed of functions, a c program may have multiple functions. to distinguish these functions, each function is given a name. The function name is a type of identifier. In addition to functions, we will also learn the concept of "variables" in the future. The variable name is also the identifier 3. Naming 1> naming rules (must comply )? It can only contain 26 English letters, 10 Arabic numerals, 0 ~ 9. What are the underscores? Strictly case sensitive. For example, test and Test are two different identifiers? Cannot begin with a number? Cannot Use keywords as identifiers 2> naming conventions (best practice )? Try to create a meaningful name, for example, a complete English word. When someone else looks at the name, the identifier can be used. If you do not understand English, you can also use Pinyin. Do not use meaningless names such as abcde and sfsdfsdf? If the identifier contains multiple words, you can use the camper mark (except for the first word, the first letter of each word is capitalized): firstName, myFirstName, or underscore _ to connect: first_name, my_first_name4. common identifiers naming errors legal identifiers illegal identifiers annotation fromNo12from #12 identifiers cannot use # symbol my_Booleanmy-Boolean identifiers do not use the '-' symbol, the underscore "_" should be used to replace Obj22ndObj. The identifier cannot start with a number. myIntint "int" is the built-in keyword jack_rosejack & rose symbol "&" cannot appear in the identifier GUIG. u. I identifier must contain ". "separator 5. exercise points out that the identifier is correct test1 Mike2jack My_tExt _ testtest! 32 haha (da) tt haha _ text 123 haha 78 text a _ 123 _

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.