Why I have the error for the following code:
const int r = 3;
int *const ptr = &r;
However it works normaly if I define r as a plain int. As I understand, the second line only defines the pointer ptr as a const, which means that the value of this pointer cannot be changed. But why I a const pointer cannot point to a const int?