I'm new to C++ and is trying to learn the concept of keyword const.
My question is why the object copied to (*p in this example) must have the same LOW level constant as the object copied from (p3 in this example).
I understand that they must have the same low level constant in order for the code to be valid, but I don't understand why this is the case.
What is the reason behind it?
const int *p2;
const int *const p3 = nullptr;
p2 = p3; //ok
int *p = p3; //error: cannot initialize a variable of type 'int *' with an lvalue of type 'const int *const'.