Identifier refers to a symbol used to identify an entity, which has different meanings in different application environments.On the computerprograming languageIn, the identifier is the name used by the user in programming. It is used to give variablesconstant、function, statement blocks, etc. to establish the relationship between name and use.Identifiers usually consist of letters and numbers and other characters.
stayProgramming languageWhere the identifier is used asprogramThe string that identifies the name of an element in the source program[1]。This element can be a statement label, a procedure or function, a data element (such as a scalar variable or an array), or the program itself.Most commonly, the word identifier is used almost synonymously with variable names.In a system in which the position of program data remains unchanged throughout the execution of the program, the identifier used for scalar variables is linked to the memory address, which in turn points to a physical unit in the memory of the machine, which in turn contains a value representation.The intermediate relationship between an identifier and a value is usually transparent to programmers, so in practice, there is confusion between the name of a variable (that is, its identifier) and its value (that is, the current content of the storage unit assigned to the identifier).In most programming languages, identifiers can be formed from any alphanumeric string, and the length is often limited (usually 6 to 8 characters), as long as the leftmost character is a letter.Some languages also allow special characters.
Identifier of programming language
Announce
edit
C language
one
The identifier consists of letters (A-Z, a-z), numbers (0-9), and the underscore "_". The first character cannot be a number, but can be a letter or an underscore.For example, the correct identifier: abc, a1, prog_to.
two
Can'tC language keywordAs a user identifier, such as if, for, while, etc.
three
The identifier length is determined by theCompiling systemIt is generally limited to 8 characters (note: the length of 8 characters is limited to C89 standard, and the length of C99 standard has been expanded, but most industrial standards are longer).
four
Identifiers are case sensitive, that is, they are strictly case sensitive.Generally, variable names are in lower case, and symbolic constants are in upper case.
five
Identifier namingIt shall“See the name, know the meaning”, for example, length, sum, pi
In C language, identifiers are divided into three categories:keyword,Predefined Identifier ,User defined identifier[2]。
C++
one
The identifier consists of letters, numbers and the underscore "_".
In assembly language, identifiers consist of letters, numbers, and underscores.
In assembly language, the naming rule of identifier is: it is composed of letters (upper and lower case), numbers and underscores, and the firstcharacterIt must be a letter or underscore, and meaningful instruction symbols or registers cannot be used.In assembly language, capital letters are generally used.
The following identifier names are legal:
year,Day,ATOK,X,_ CWS,HAO
The following identifier names are illegal:
#123,.COM,$100,1996Y,1_2_3,Win3.2,LOOP,AX
python
In Python, identifiers consist of letters, numbers, and underscores.
In python, all identifiers can include English, numbers, and underscores (_), but cannot start with a number.Identifiers in python are case sensitive.
Identifiers that begin with an underscore have a special meaning.A single underscore (_foo) indicates that theClass Properties, it needs to be accessed through the interface provided by the class, and cannot be imported with "from xxx import *";(__foo) starting with double underscore represents the private member of the class;The (__foo__) that starts and ends with a double underscore represents the special identifier for special methods in python, for example, __init__ () represents theConstructor。
Delphi
Delphi languageIt is a Windows application development system based on Object Pascal language. It is used in all event processing and application programs to write program code.
Delphi language identifier is the name used to represent application quantity in Object Pascal language.include:variable(Var)、constant(Const), Type, Procedure, Method, etc.Identifier is divided into standard identifier and user-defined identifier.Standard identifiers are pre assigned to standard constants, standard typesStandard function, standard process and standard document.For example, standard constants: False, True; standard types: integer, char, real; standard functions: Abs, Sqr, Cos, etc.Custom identifiers are constants, variables, types, functions, procedures and program names that programmers define for themselves as needed.The object Pascal identifier consists of letters, numbers and underscores, which are specified as follows:
(3) Avoid being the same as the standard identifier already used by Object Pascal.
VB
The first one is English uppercase, lowercase letters or Chinese characters, followed by a number of numbers, English uppercase and lowercase letters (letters are not case sensitive), the underscore '_' or dollar sign '$', and the total length should not exceed 255.In Basic, identifiers are not case sensitive。In addition, in computer language, some identifiers are predefined for special purposes, which we callkeywordTherefore, the identifier you name cannot be the same as the keyword.Another situation that must be noted is that in the sameScopeThe same identifier is not allowed to be defined within.
Example of correct identifier: W_absd1234,LLLLl ,ab2cd3ef4 。
In Basic, identifiers are not case sensitive, so LLlll and LLLLl refer to the same identifier, and AB2cd3ef4 and ab2cd3ef4 refer to the same identifier
Example of error identifier:A12@34Is an incorrect identifier, because the @ character cannot form an identifier;1234 is a wrong identifier because it does not start with a letter;If is an incorrect identifier because it is akeyword。
flash as3
1. In AS3.0,variable, classes, and functions need certain names to distinguish them from each other, and to be applied accurately in programs.These distinguished names with specific meanings are called identifiers.
2. According to the defined places, identifiers are divided into two categories: language built-in identifiers and user-defined identifiers.
Language Built in Identifier: The language built in identifier is defined within the language.
User defined identifier: the name created by the user is the user defined identifier
The technical restrictions on identifiers in AS3.0 mainly include the following
(1) All identifiers are case sensitive.(2) First of identifiercharacterIt must be English letters (including uppercase or lowercase letters).(3) The identifier shall consist of numbers (0-9), all uppercase letters from "A" to "Z", lowercase letters from "a" to "z", and the underscore "_".(4) It cannot conflict with the built in custom word of AS3.0k.Common Built in Guan Jian Zi