C++ is a statically typed language. The language enforces type safety and protects you from mistakes by rejecting arbitrary conversions between unrelated types. The meaning of a type is not wholly described by the size alone.
If an address contains an object of type int*
, then a int**
can point to that object. Given that the address contains an object of type int*
, it cannot possibly also contain an object of type double
, so there is no meaningful way to convert one of those pointers to another.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…