test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
22
.config/Code/User/History/-7e055f1a/qCX2.cpp
Normal file
22
.config/Code/User/History/-7e055f1a/qCX2.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
class A
|
||||
{
|
||||
public:
|
||||
A(int ii = 0) : i(ii) {}
|
||||
A(int ii, int ss) : i(ii + ss) {}
|
||||
void show() { cout << "i = " << i << endl; }
|
||||
~A() { cout << "Out A" << i << endl; }
|
||||
A magic(int ss){
|
||||
this->i = ss * this->i;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
int i;
|
||||
};
|
||||
int main()
|
||||
{
|
||||
A a(10, 5), s(10);
|
||||
a = s.magic(20).magic(10);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue