Constant
From Coderwiki
More actions
Constants in programming are variables in which their value does not change during the runtime of the program.
Compile-time constants
Some programming languages evaluate constants at compile time. This means that their value is worked out by the compiler and is then hardcoded into the binary.
For these compile-time constants, they can't use any functions or data that is only available at runtime. For example, compile-time constants can't take in user input or call any other non-constant function.
Declaring and initializing constants
Declaring a constant is usually the same as variable declaration, but using an extra/different keyword, usually const.
Similarly, initializing a constant is usually the same as variable initialization, but using an extra/different keyword, usually const.