There are three main rules for naming variable names: they can only be composed of letters, numbers, and underscores, and the first character must be an English letter; the effective length is 255 letters; it cannot contain punctuation marks and types. specifier.
The first letter of the variable name must be a letter, an underscore, or a dollar sign. All variables in programming must start with a dollar sign. (Some compilers already support Chinese variable names) Variable names can only be a combination of letters, numbers (0-9), and underscores, and cannot contain spaces. Numbers cannot be placed at the beginning of the variable name. Variable names cannot use reserved words of programming languages.
Because variable names are case-sensitive, they can be in any combination of upper and lower case letters. In fact, it is also possible to use Chinese variable names. But in real programming, it is customary to use English letters for naming.
What is the variable name?
A variable represents a storage unit whose value is variable, so it is called a variable. Variable names, constant names, function names, array names, etc. are all artificially named to distinguish different entities in the program. These names are usually called identifiers.
The naming rules for identifiers are as follows: identifiers can be composed of three types of characters: letters, underscores, and numbers; identifiers can only start with letters or underscores; identifiers cannot be ambiguous; identifiers have The length requirement is in the given name! The part that exceeds the specified length will be truncated.