Home>Article>Backend Development> What are the legal identifiers in C language?

What are the legal identifiers in C language?

hzc
hzc Original
2020-07-02 11:28:21 39784browse

C language identifier refers to a symbol used to identify an entity. It has different meanings in different application environments. The identifier consists of letters [A-Z, a-z], numbers [0-9], It consists of underscore "_", and the first character cannot be a number, but can be a letter or underscore. Correct identifiers: abc, a1, prog_to, etc.

What are the legal identifiers in C language?

#In assembly language, identifiers consist of letters, numbers, and underscores. The naming rules for identifiers are: they consist of letters (upper or lower case), numbers and underscores, and the first character must be a letter or underscore, and meaningful instruction symbols or registers cannot be used. In assembly language, capital letters are generally used.

In python, identifiers are composed of letters, numbers, and underscores. All identifiers can include English, numbers, and underscores (_), but cannot start with a number. Identifiers in Python are case-sensitive.

Identifiers starting with an underscore have special meaning. Those starting with a single underscore (_foo) represent class attributes that cannot be accessed directly. They need to be accessed through the interface provided by the class and cannot be imported using "from xxx import *". Those starting with a double underscore (__foo) represent private members of the class.

C language identifier refers to a symbol used to identify an entity. It has different meanings in different application environments. The identifier consists of letters (A-Z, a-z), numbers (0-9), It consists of an underscore "_", and the first character cannot be a number, but it can be a letter or an underscore. For example, correct identifiers: abc, a1, prog_to.

The length of the identifier is determined by the compilation system on the machine. The general limit is 8 characters (Note: The 8-character length limit is the C89 standard. The C99 standard has expanded the length. In fact, most industrial standards are longer. ). Identifiers are case-sensitive, that is, they are strictly case-sensitive. Generally use lowercase letters for variable names and uppercase letters for symbolic constants

What are the legal identifiers in C language?

Recommended tutorial: "c Language Tutorial"

The above is the detailed content of What are the legal identifiers in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn