To make the object a
read-only object, we apply the
const qualifier to its declaration. Once initialized, these objects become read-only, and we call them
constants. Attempting to change their values results in a
compile-time error. Let us write an example that defines a few simple constants:
int main(void)
{
const char c = 'a';
const int x = 123;
const double d = 456.789;
printf("We have defined three constants.\n");
printf("Their values are: %c, %d, %.3f.\n", c, x, d); ...