之前老师没讲过引用作返回值的引用类型啊,Array&要怎么理解啊,引用作返回值类型有什么用都没说啊。。
2017-04-17
class Coordinate
{
public:
Coordinate(){}
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
public:
int m_iX;
int m_iY;
};
Coordinate coorArr[2];
coorArr[0].m_iX = 1;
coorArr[0].m_iY = 2;
coorArr[1].m_iX = 3;
coorArr[1].m_iY = 4;
因为成员变量是public呀
{
public:
Coordinate(){}
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
public:
int m_iX;
int m_iY;
};
Coordinate coorArr[2];
coorArr[0].m_iX = 1;
coorArr[0].m_iY = 2;
coorArr[1].m_iX = 3;
coorArr[1].m_iY = 4;
因为成员变量是public呀