#include <iostream>
using namespace std;
class point
{
private:
int aa,aaa;//不能再类内初始化数据成员
public:
point(int c,int d)//标准的构造函数构建(标准方法)
{
aa=c;
aaa=d;
}
void show();//成员函数
};
void point::show()
{
cout<<"("<<aa<<","<<aaa<<")"<<endl;
}
int main()
{
point a(10,11);//定义一个对象并初始化
a.show();
return 0;
}
using namespace std;
class point
{
private:
int aa,aaa;//不能再类内初始化数据成员
public:
point(int c,int d)//标准的构造函数构建(标准方法)
{
aa=c;
aaa=d;
}
void show();//成员函数
};
void point::show()
{
cout<<"("<<aa<<","<<aaa<<")"<<endl;
}
int main()
{
point a(10,11);//定义一个对象并初始化
a.show();
return 0;
}