#includeusing namespace std;struct Object{
int a;
int b;};void main(){
Object& MyFunction(int b,int a=20);
Object& rMyObj = MyFunction(5);
cout<<"rMyObj.a="<
delete &rMyObj;}Object& MyFunction(int b,int a){
Object *o = new Object;
o->a = a;
o->b = b;
return *o;}最后一句为啥return *o,而不是return o;或者return &o?
- 2 回答
- 0 关注
- 587 浏览
添加回答
举报
0/150
提交
取消