Update README.md
This commit is contained in:
parent
eef2a1989c
commit
93f3d96f03
@ -114,9 +114,9 @@ int main(void)
|
||||
Base &p = d; // 基类引用指向派生类实例
|
||||
cout<<"基类对象直接调用"<<endl;
|
||||
ptr.fun1();
|
||||
cout<<"基类引用指向派生类实例"<<endl;
|
||||
cout<<"基类对象调用基类实例"<<endl;
|
||||
pp.fun1();
|
||||
cout<<"基类指针指向派生类实例并调用虚函数"<<endl;
|
||||
cout<<"基类指针指向基类实例并调用虚函数"<<endl;
|
||||
pt->fun1();
|
||||
cout<<"基类引用指向基类实例并调用虚函数"<<endl;
|
||||
p.fun1();
|
||||
|
Loading…
Reference in New Issue
Block a user