class Coordinate
{
public:
Coordinate(int x,int y)
{
m_iX = x;
m_iY = y;
}
// 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
};
int main(void)
{
//定义对象数组
Coordinate coorArr[2]={Coordinate(1,2),Coordinate(3,4)};
}
{
public:
Coordinate(int x,int y)
{
m_iX = x;
m_iY = y;
}
// 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
};
int main(void)
{
//定义对象数组
Coordinate coorArr[2]={Coordinate(1,2),Coordinate(3,4)};
}
Coordinate()
{
}
// 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")";
}
public:
int m_iX;
int m_iY;
};
int main(void)
{
//定义对象数组
Coordinate coorArr[2];
for(int j=0;j<2;j++)
{
coorArr[j].m_iX=2*j+1;
coorArr[j].m_iy=2*j+2;
}
{
}
// 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")";
}
public:
int m_iX;
int m_iY;
};
int main(void)
{
//定义对象数组
Coordinate coorArr[2];
for(int j=0;j<2;j++)
{
coorArr[j].m_iX=2*j+1;
coorArr[j].m_iy=2*j+2;
}