int is: int
i is: int
pi is: int *
*pi is: int
derived is: struct Derived
*pbase is: struct Base
same type? false
polyderived is: struct Poly_Derived
*ppolybase is: struct Poly_Derived
same type? true
, but when I ran the very same code, it printed this:
int is: i
i is: i
pi is: Pi
*pi is: i
derived is: 7Derived
*pbase is: 4Base
same type? false
polyderived is: 12Poly_Derived
*ppolybase is: 12Poly_Derived
same type? true
I think it's highly questionable that any implementation would print "i" as the name of the type of "*pi". I will take a wild guess and say that the op's code is not actually the same.