Update README.md

This commit is contained in:
Francis
2020-06-14 19:11:12 +08:00
committed by GitHub
parent eef2a1989c
commit 93f3d96f03

View File

@@ -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();