首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

Bridge方式C++代码

2012-08-14 
Bridge模式C++代码H 文件#include iostream#include Rectangle.husing namespace stdvoid main(void)

Bridge模式C++代码

H 文件

#include "iostream"#include "Rectangle.h"using namespace std;void main(void){  Drawing* pV1Drawing = new V1Drawing;  Drawing* pV2Drawing = new V2Drawing;    Rectangle cRectangle1(pV1Drawing);  cRectangle1.draw();  Rectangle cRectangle2(pV2Drawing);  cRectangle2.draw();  Circle cCircle1(pV1Drawing);  cCircle1.draw();  Circle cCircle2(pV2Drawing);  cCircle2.draw();  delete pV1Drawing;  delete pV2Drawing;}



热点排行