|
Note:
|
int main(int argc, char *argv[])
{
int const a = 4; // Initial value
printf (" a = %d\n", a);
a = 1; // Illegal !!!
printf (" a = %d\n", a);
}
|
Result:
UNIX>> gcc const1.c const1.c: In function 'main': const1.c:12: error: assignment of read-only variable 'a' |
How to run the program:
|
const DataType varName ;
|
Example:
const int a ; |
|
This will be explained later in this webpage: click here