阿u盾地方 阿u盾地方
关注数: 203 粉丝数: 6,796 发帖数: 8,747 关注贴吧数: 27
新手求帮助                                                                                                                                                                                                                                                                                                                                                                                    `#include<iostream.h> class Point{      private:          intX,Y;       public:           Point(int a=0,int b=0) {X=a; Y=b;count<<"Initializing"<<endl;}      point(const point &p);      int Get(){return X;}       int Get(){return Y;}       void Show(){cout<<"X="<<X<<",Y="<<Y<<endl;}      ~point(){cout<<"delete..."<<X<<","<<Y<<endl;} }; point::point(const point &p) {        X=p.X;        Y=p.Y;        count<<"Copy Initializing " << endl; } void display(Point p) {p.Show();} void disp(Point&p) {p.Show();} Point fun() {       Point A(101,202);       return A; } void main(){      Point A(42,45);      Point B(A);      Point C(58,94);      cout<<"called display(B)"<<endl;      display(B);      cout<<"Next..."<<endl;      cout<<"called disp(B)" <<endl;      disp(B);       count<<"call C=fun()"<< endl;      C=fun();      count<<"called disp(C)"<< endl;      disp(C);      count <<"out..."<<endl; }
首页 1 2 3 4 下一页