Open topic with navigation
Defines a variable which cannot be modified by any other part in the code. You place the keyword const in front of any variable declaration. If the keyword volatile is placed after const, then this allows external routines to modify the variable (such as hardware devices). This also forces the compiler to retrieve the value of the variable each time it is referenced rather than possibly optimizing it in a register.
Constant numbers can be defined in the following way:
|Hexadecimal digits||Where hexadecimal digits is any digit or any letter A through F or a through f.|
|Decimal digits||Any number where the first number is not zero|
|Octal constant||Any number where the first number must be zero.|
A fractional number, optionally followed by either e or E, then the exponent. The number may be suffixed by:
U and L/LL can be combined.