| 天极软件专题专区精选 | ||
| Google专区 | POPO专区 | QQ专区 |
| Flash MX 视频教程 | Photoshop视频教程 | 网页设计视频教程 |
| PowerPoint动画演示教程 | Excel动画教程集 | Word动画演示教程 |
| 特洛伊木马专区 | 黑客知识教程专区 | 注册表应用专区 |
| Windows API开发专区 | 网络编程专区 | VB数据库编程专区 |
| class Shape { public: // 使用Shapes的用户的接口 virtual void draw() const; virtual void rotate(int degrees); // ... protected: // common data (for implementers of Shapes) Point center; Color col; // ... }; class Circle : public Shape { public: void draw() const; void rotate(int) { } // ... protected: int radius; // ... }; class Triangle : public Shape { public: void draw() const; void rotate(int); // ... protected: Point a, b, c; // ... }; |
| class Shape { public: //使用Shapes的用户的接口 virtual void draw() const = 0; virtual void rotate(int degrees) = 0; virtual Point center() const = 0; // ... // 没有数据 }; class Circle : public Shape { public: void draw() const; void rotate(int) { } Point center() const { return center; } // ... protected: Point cent; Color col; int radius; // ... }; class Triangle : public Shape { public: void draw() const; void rotate(int); Point center() const; // ... protected: Color col; Point a, b, c; // ... }; |
| class Shape { public: //使用Shapes的用户的接口 virtual void draw() const = 0; virtual void rotate(int degrees) = 0; virtual Point center() const = 0; // ... // no data }; struct Common { Color col; // ... }; class Circle : public Shape, protected Common { public: void draw() const; void rotate(int) { } Point center() const { return center; } // ... protected: Point cent; int radius; }; class Triangle : public Shape, protected Common { public: void draw() const; void rotate(int); Point center() const; // ... protected: Point a, b, c; }; |