class parent { public: char p; parent() { p = 'a'; } }; class child: public parent { public: char c; child() { c = 'b'; } }; class other { public: class parent *ptr; }; int main() { other test; test.ptr = new child; printf("p: %c", test.ptr->c); /* 32 `class parent' has no member named `c' */ return 0; }