J
junky_fellow
guys,
If I declare a const variable and then try to change it as follows;
const int i=5;
i = 10;
What would be the behaviour? Should compiler give compilation error or
Warning ?
Or, would I get a run time error (some exception as I am trying to
change a
const variable) ?
can compiler put const variables in read only memory ?
I tried this on multiple platforms using different compiler and I am
getting
different results, that is why I am asking this here.
I want to know the correct behaviour as per the standard C.
Again, thanks a lot for any help ...
If I declare a const variable and then try to change it as follows;
const int i=5;
i = 10;
What would be the behaviour? Should compiler give compilation error or
Warning ?
Or, would I get a run time error (some exception as I am trying to
change a
const variable) ?
can compiler put const variables in read only memory ?
I tried this on multiple platforms using different compiler and I am
getting
different results, that is why I am asking this here.
I want to know the correct behaviour as per the standard C.
Again, thanks a lot for any help ...