📄 main.cpp
字号:
/********************************************************************
created: 2006/07/20
filename: Main.cpp
author: 李创
http://www.cppblog.com/converse/
purpose: Decorator模式的测试代码
*********************************************************************/
#include "Decorator.h"
#include <stdlib.h>
int main()
{
// 初始化一个Component对象
Component* pComponent = new ConcreateComponent();
// 采用这个Component对象去初始化一个Decorator对象,
// 这样就可以为这个Component对象动态添加职责
Decorator* pDecorator = new ConcreateDecorator(pComponent);
pDecorator->Operation();
delete pDecorator;
system("pause");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -