多文件及复制构造函数实例_默认复制构造函数

其他范文 时间:2020-02-27 19:13:28 收藏本文下载本文
【www.daodoc.com - 其他范文】

多文件及复制构造函数实例由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“默认复制构造函数”。

#include//保存为rect.cpp #include”rect.h”

using namespace std;

Rectangle::Rectangle(intl,intt,intr,int b){left=l;top=t;right=r;bottom=b;} Rectangle::Rectangle(Rectangle &rec){left=rec.left;top=rec.top;

right=rec.right;bottom=rec.bottom;} void Rectangle::Aign(intl,intt,intr,int b){

} left=r;top=t;right=r;bottom=b;} cout

cla Rectangle{//保存为rect.hintleft,top,right,bottom;

public:

Rectangle(int l=0,intt=0,int r=0,int b=0);Rectangle(Rectangle &rec);

};~Rectangle(){};void Aign(int ,int ,int ,int);voidSetleft(int t){left=t;} voidSetRight(int t){right=t;} voidSettop(int t){top=t;} voidSetBottom(int t){bottom=t;;} void Show();

#include“rect.cpp”

#include

using namespace std;

int main(){

Rectangle rect;

} rect.Show();rect.Aign(100,200,300,400);rect.Show();Rectangle rect1(0,0,200,200);rect1.Show();Rectangle rect2(rect1);cout

下载多文件及复制构造函数实例word格式文档
下载多文件及复制构造函数实例.doc
将本文档下载到自己电脑,方便修改和收藏。
点此处下载文档

文档为doc格式

    热门文章
      整站推荐
        点击下载本文