从“CSon *”到“CFather *”的转换存在,但无法访问,why?
代码如下,问题如题,求讲解,谢谢大家
#include <iostream>using namespace std;class CFather{private: int age;public: int money;public: CFather() { } ~CFather() { }};class CSon:CFather{public: CSon() { } ~CSon() { }};int main(){ CFather *son = new CSon; system("pause"); return 0;}