Constant pointer life time

hello!
please if we have a constant pointer like:

[code]
int a=1;
int b=2;
int c=3;

int* const pa=&a;
/*pa=&b or
pa=&c; are ERRORS cause pa is only READ ONLY!*/

[/codeg

my question is: how long is pa "blocked " like this- in the scope (block) I suppose!!!

Many thanks!!!


As long as it exists. Of course, there are ways to 'deconstify' the value, such as const_cast, but these should be avoided (otherwise whats the point of it being 'const' anyway?).
THANKS!!!
Topic archived. No new replies allowed.