2、.h>classStudent{public:Student(char*pName="noname",intssId=0){strncpy(name,pName,40);name[39]=' ';id=ssId;cout<<"Constructingnewstudent"<3、udent(){cout<<"Destructing"<4、递时调用拷贝构造函数cout<<"Returnedfromfn()";}//主函数调用结束时,先析构对象wang,再析构对象randy程序的运行结果为:ConstructingnewstudentRandyConstructingnewstudentwangCallingfn()ConstructingcopyofRandyInfunctionfn()DestructingcopyofRandyReturnedfromfn()DestructingwangDestructingRandy缺省构造函数#include#i
5、ncludeusingnamespacestd;classStudent{public:Student(char*pName){cout<<"calloneparameterconstructor"<