May 3, 2015

Difference between ' const int* ' and ' int* const '

<const meaning of location>

const int* ptr; (value locked) - generally use
++*ptr; (X)  ------> cannot change value
++ptr;  (O)

---------------------------------------------------

int* const p; ------> int* p(address locked)

++*p; (O) ------> can change value
++p; (X)   ------> cannot move address

----------------------------------------------------

const int* const pp = ar; (value and address locked)

++*pp; (X) ------> cannot change value
++pp; (X)  ------> cannot move address

-----------------------------------------------------
(+)
http://stackoverflow.com/questions/1143262/what-is-the-difference-between-const-int-const-int-const-and-int-const