
本文共 2229 字,大约阅读时间需要 7 分钟。
���������������������������
���������������C++������������������������������������������������������������������������������������
������������
������������������������������������������������������������������������������������:void������������������������������������������������������������
������������������
������������������������������������������������������������������������������������������������������
Line(){ cout << "Object is being created" << endl;}
������������������������������
Line Line() { cout << "Object is being created" << endl;}
���������C++���������������������������������public������������������
������������������������
������������������������������������������������������������������������������������������������
Line(double len){ cout << "Object is being created, length = " << len << endl; length = len;}
������������������������������������������������
������������������������������
������������������������������������������������������������������������������������������������������
Line(double len = 20.0){ cout << "Object is being created, length = " << len << endl; length = len;}
���������������������������������������������������
���������������
���������������������������������������������������������������������������
Line(double len) : length(len){ cout << "Object is being created, length = " << len << endl;}
���������������������������
Line(double len){ length = len; cout << "Object is being created, length = " << len << endl;}
���������������������������������������������������������������
������������
������������������������������������������������������������������������~
���������������������������������������
���������������������������
������������������������������������������
Line::~Line(){ cout << "Object is being deleted" << endl;}
������������������������������������������������������������
������������������
������������������������������������������������������������������������������������
Line line;// ������������line.setLength(6.0);cout << "Length of line : " << line.getLength() << endl;// ������������������������������������������������
Line line;Line::~Line();
���������������line
������������������������������
发表评论
最新留言
关于作者
