91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.12KB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2021-02-21
  • 標簽:

資源簡介

C++實戰源碼-適配器模式的簡單應用(入門級實例225).zip

資源截圖

代碼片段和文件信息

//?adapter.cpp?:?Defines?the?entry?point?for?the?console?application.
//

#include?“stdafx.h“
#include?“ioStream.h“
#include?“string.h“

typedef?char?String[30];
struct?Point
{
int?xy;
};

class?Car?{
private:
String?name; //表示名稱
????double?speed; //表示速度
public:
double?getSpeed(){
return?speed;
}
void?setSpeed(double?sp)
{
speed?=?sp;
}
char?*getName()
{
return?name;
}
void?setName(String?Name)
{
strcpy(nameName);
}
public:
virtual?void?toString()?{
????????cout?<????????<????}
};

class?GPS?{
????virtual?Point?getLocation()?=?0;//提供定位功能
};

class?GPSCar?:public?Car??GPS?{
public:
Point?getLocation()?{//利用汽車的速度來確定汽車的位置
????????Point?point;
point.x?=?getSpeed();
point.y?=?getSpeed();
????????return?point;
????}
????void?toString()?{
Car::toString();
????????cout?<????}
};



?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1428??2010-10-14?19:37??adapter\adapter.cpp
?????文件????????4548??2010-10-14?19:14??adapter\adapter.dsp
?????文件?????????539??2010-10-14?19:14??adapter\adapter.dsw
?????文件?????????294??2010-10-14?19:14??adapter\StdAfx.cpp
?????文件?????????769??2010-10-14?19:14??adapter\StdAfx.h

評論

共有 條評論