正在加载图片...
1.C艹+语言的面向对象特征 1.对象模型:多态 日 class base ublic. virtual void Printo[ (1)类属:虚函数 cout<<Base: Print("<endl class Derive: public Base publi virtual void Print Oq at<< D Printo"<<endl 用父类的指针指向其子 类的实例,然后通过父 F int mainO( 类的指针调用实际子类 Derive derive Base *pBase =&derive 的成员函数,这种技术 return 0 可以让父类的指针有“ 多种形态”; Ci- C Windows\system32\cmd.exe Derive:: Print() 请按任意键继续1. C++语言的面向对象特征 1. 对象模型:多态 – (1) 类属:虚函数 用父类的指针指向其子 类的实例,然后通过父 类的指针调用实际子类 的成员函数,这种技术 可以让父类的指针有“ 多种形态”;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有