类的外部调用私有函数的方法

  • Post author:
  • Post category:其他


class father1

{

public:



virtual void Output();

};

class son:public father1

{

private:



void Output();

};

int main()

{




son sonInst;



father1 &faInst = sonInst;



faInst.Output();



//father1 * pFather=new son();



//pFather->Output();



return 1;

}



版权声明:本文为lnwaycool原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。