C++primer 15.6节练习

练习15.23

 1 class Base {
 2 public:
 3     virtual int fcn();
 4 };
 5 
 6 class D1 : public Base {
 7 public:
 8     int fcn();
 9     virtual void f2();
10 };
11 
12 class D2 : public D1 {
13 public:
14     int fcn(int);
15     int fcn();
16     void f2();
17 };
18 跟bp2有关的需要重新解析:bp2->fcn(); 运行的是D1::fcn

 

posted @ 2017-09-16 20:37  五月份小姐  阅读(200)  评论(0编辑  收藏  举报