f1305.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //=====================================
- // f1305.cpp
- // Sony2 Derived from Sony
- //=====================================
- #include"createsony.h"
- #include"sony2.h"
- enum Technology{ PUREFLAT, PLASMA, LIQUIDCRYSTAL };
- //-------------------------------------
- void fn(Sony* s){
- Sony2* ps2 = dynamic_cast<Sony2*>(s); // added
- if(ps2) ps2->adjustLight(); // else don't use it
- ps2->adjustVolume();
- ps2->switchChannel();
- }//------------------------------------
- void createSonyObject(CreateSony* sp){
- Sony* s29 = createSonyInch29(sp);
- fn(s29);
- delete s29;
- }//------------------------------------
- int main(){
- if(CreateSony* sp = createCreateSony(LIQUIDCRYSTAL)){
- createSonyObject(sp);
- delete sp;
- }
- }//====================================