#include
///////////////////////////////////////
class Point///声明了Point的类
{
public:
Point():x(0),y(0)///带默认参数的构造函数
{
cout<<"Default Constructor called."<
Point(int x,int y):x(x),y(y)///带参数的构造函数
{
cout<<"Constructor called."<
~Point(){cout<<"Destructor called."<
int getX() const{return x;}
int getY() const{return y;}
void move(int newX,int newY)
{
x=newX;
y=newY;
}
//////////////////////////////////
private:
int x,y;///类的数据成员
};
///////////////////////////////////////////////////////////
int main()
{
cout<<"Step one:"<
delete ptr1;///指针的释放调用析构函数///输出Destructor called.
cout<<"Step two:"<
delete ptr1;///指针的释放调用析构函数///输出Destructor called.
return 0;
}
int main()
{
cout<<"Step ont:"<
cout<<"Step two:"<
return 0;
}
楼主要引用干什么呢?