下列程序运行结果是 。 class test{ long x; static int num; public: test (long m=0) {x=m;} test operator++(); test operator++(int); void Show() { cout<<"the num is: the answer">
2、下列程序运行结果是 。 #include <iostream.h> class A { long x; public: A(long m) {x=m;} void Show() { cout<<"count="<<count<<",x="<<x<<endl; } a& operator++(); operator++(int); static int count; }; a::operator++() { ++x; ,x="<<x<<endl; return *this; } A&A::operator++(int) { cout<<" count="<<count++<<" answer">
3、下列程序运行结果是 。 class sample{ int x , y ; public : sample( ) { x=y=0 ; } sample( int i , int j) {x=i ; y=j ; } void copy( sample &obj) { *this=obj ; } sample operator--( ) { x-- ; y-- ; return *this; } void print( ){ cout << x << " " << y<< " " ; } } ; void main( ) { sample c1(1 , 2) , c2 ; --c1; c1.print( ) ; c2.copy(c1) ; --c2; c2.print( ) ; }