标题:求助:请高手给分析一下程序流程
取消只看楼主
天子狂鹰
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-12-1
 问题点数:0 回复次数:0 
求助:请高手给分析一下程序流程
#include<iostream.h>
class A
{protected:int x,y;
public:
   A(int x1=0,int y1=0)
   {x=x1;y=y1;}
   A(A &s){x=s.x;y=s.y;
           cout<<"*****1"<<endl;
   }
   A &operator=(A &s)
   {x=s.x;
   y=s.y;
   cout<<"*****2"<<endl;
   return *this;
   }
   void display()
   {cout<<x<<y<<endl;}
   ~A(){cout<<"out class A!"<<endl;}
};
void fn(A s)
{cout<<"*****3"<<endl;
s.display();
}
main(){A a(1,1),b(2,2);
A c=a;
fn(a);
a=b;
}
最好详细一点,谢谢
搜索更多相关主题的帖子: 流程 int 
2007-12-24 14:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-194048-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.144167 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved