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

2020-02-27 其他范文 下载本文

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

#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

《多文件及复制构造函数实例.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
多文件及复制构造函数实例
点击下载文档
相关专题 默认复制构造函数 函数 实例 文件 默认复制构造函数 函数 实例 文件
[其他范文]相关推荐
    [其他范文]热门文章
      下载全文