S
siliconwafer
Hi All,
If I declare an identifier with a const keyword and not initilize
it.Then later on I assign it value of an expression.Is it fine?
I feel yes.But if I modify the value of that constant like say an
operation like,
const int i;
int a,b;
i = a + b;
.....
i++;
Then my compiler(gcc 2.95.1) issues a warning.
If I neglect the warning and ontinue the operation,what will happen?
The value gets modified?
will it result in following run time error?
"segmentation fault"?
-Siliconwafer
If I declare an identifier with a const keyword and not initilize
it.Then later on I assign it value of an expression.Is it fine?
I feel yes.But if I modify the value of that constant like say an
operation like,
const int i;
int a,b;
i = a + b;
.....
i++;
Then my compiler(gcc 2.95.1) issues a warning.
If I neglect the warning and ontinue the operation,what will happen?
The value gets modified?
will it result in following run time error?
"segmentation fault"?
-Siliconwafer