2 ms·
In part. Pointers can be made constant in two ways, a) constant in that they cannot be used to change the memory they point to, and b) in that one cannot change
by krylon 12y ago
In part. Pointers can be made constant in two ways, a) constant in that they cannot be used to change the memory they point to, and b) in that one cannot change what memory they point to.
char const * ptr_a; /* You cannot write to the memory pointed to by ptr */
char * const ptr_b; /* You cannot change what ptr_b points to */
char const * const ptr_ab; /* You neither change what ptr_ab points to nor the memory it points to - at least not through this pointer */