- Constants, often known as literals, are fixed values that the program cannot change.
- Constants are separated into Integer Numerals, Floating-Point Numerals, Characters, Strings, and Boolean Values and can be of any of the basic data kinds.
- Constants are processed similarly to ordinary variables, with the exception that their values cannot be changed after they have been defined.
There are two simple ways in C++ to define constants −
Using #define preprocessor.
Using const keyword.