Identifiers
Identifiers are arbitrary names of any length given to functions, variables, symbolic constants, user-defined data types and labels. All these program elements will be referred to as objects throughout the help (don't get confused with the meaning of object in object-oriented programming).
Identifiers can contain the letters a to z and A to Z, underscore character “_”, and digits from 0 to 9. The only restriction is that the first character must be a letter or an underscore.
Case Sensitivity
The mikroC PRO for PIC32 identifiers aren't case sensitive by default, so that Sum
, sum
, and suM
represent
an equivalent identifier. Case sensitivity can be activated or suspended in Output Settings window.
Even if case sensitivity is turned off Keywords remain case sensitive and they must be written in lower case.
Uniqueness and Scope
Although identifier names are arbitrary (according to the stated rules), if the same name is used for more than one identifier within the same scope and sharing the same name space then error arises. Duplicate names are legal for different name spaces regardless of scope rules. For more information on scope, refer to Scope and Visibility.
Identifier Examples
Here are some valid identifiers:
temperature_V1 Pressure no_hit dat2string SUM3 _vtext
… and here are some invalid identifiers:
7temp// NO -- cannot begin with a numeral%higher// NO -- cannot contain special charactersint// NO -- cannot match reserved wordj23.07.04// NO -- cannot contain special characters (dot)
What do you think about this topic ? Send us feedback!