65,186
社区成员




#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
class A
{
public:
int value;
A(int n=1)
{
value=n;
}
A(const A & a)
{
value=a.value;
cout<<"copied with "<<value<<endl;
}
};
A func()
{
A a(3);
return a;
}
int main()
{
cout<<func().value;
system("pause");
return 0;
}