In c++

int d=1;
const int *const ptr = &d;   means ptr is const ptr to const object .So
neither ptr nor d can be changed. But

when i do -
 d=5;
cout<<d<<" "<<*ptr;
the values are changed. Why is it so?
Moreover doing something like : *ptr=5 gives error. Can someone explain
internals here?
-- 
........................
*MOHIT VERMA*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to