#include <iostream>
using namespace std;
class Point
{
public:
Point( );
Point( int a, int b );
void display( );
void display( int a1, int b1 );
private:
int a1;
int b1;
};
Point::Point()
{
a1 = 0;
b1 = 0;
}
Point::Point( int a, int b )
{
a1 = a;
b1 = b;
}
void Point::display()
{
cout << a1 << " " << b1 << endl;
}
void Point::display( int a1, int b1 )
{
this->a1 = a1;
this->b1 = b1;
}
int main( )
{
Point pt( 3, 4 );
pt.display( 5, 6 );
pt.display();
return 0;
}
//this指针C++提供的一个指向类对像的指针,它方便对对象成员进行访问!!!
//同事在MFC中,可以利用它来列出成员列表,提高了编程的速度和效率!!!