lzhenf

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年12月28日

摘要: 第五章 代理类 :为了实现容器或数组的多态性。 1 #include <iostream> 2 3 using namespace std; 4 5 class Vehicle 6 { 7 public: 8 virtual void start() const = 0 ; 9 virtual Vehicle* copy() const = 0 ;10 virtual ~Vehicle() {};11 };12 13 14 class AutoVehicle : public Vehicle 15 {16 public:17 void start() con... 阅读全文
posted @ 2011-12-28 00:36 lzhenf 阅读(248) 评论(0) 推荐(0) 编辑