The use of const with a pointer can make the pointee not modifiable by dereferencing it using the pointer in question. But why neither can I modify what the pointer is not direc
Let's think about the type of the expressions.
const int* ptr = &a;
The type of ptr is const int*.
ptr
const int*
So the type of *ptr is const int. Not modifiable.
*ptr
const int
The type of (ptr + 2) is still const int* so the type of *(ptr + 2) is const int which is again not modifiable.
(ptr + 2)
*(ptr + 2)