There are two forms of const statement. These areA manifest constant is a constant with a name. There is no storage allocated to it in the program. It is used to assign meaning to a number.
- manifest constant
- constant data
Constant data on the other hand is data that is stored in the programs code space. Tables and strings which do not change when a program is executed are normally declared as constant data and stored in the programs code space.
constant data is declared with a type (shown here in green)
e.g. const long bert = 1manifest constants are declared without a type
e.g. const fred = 100A constant data array (or table) is declared with multiple values
e.g. const long bert = 1, 2, 3, 5, 7, 11, 13A constant string is a constant data array of characters and is defined as
e.g. const char bill = "hello world"