What is integer constant in C?
Integer constant in C is a data type that is represented by const int. const int is capable of storing an integer in decimal, octal, and hexadecimal bases. The value to const int is assigned only when it is declared and cannot be changed afterward.
Declaration
The declaration of const int is shown below:
Examples
Consider the table below, which shows examples of the declaration of const int in decimal, hexadecimal, and octal bases.
Data type | Value range (in decimal) | Decimal | Hexadecimal | Octal |
int | -2147483648 to 2147483647 |
|
|
|
unsigned | 0 to 4294967295 |
|
|
|
long | -9223372036854775807 to 9223372036854775807 |
|
|
|
unsigned long | 0 to 1844674407370955169 |
|
|
|
Free Resources