拷贝构造函数m_pArr不是直接赋值arr的m_arr(m_pArr不是直接赋值arr的m_arr)这句话是什么鬼,
m_pArr不是被赋值的函数吗,还有arr的m_arr是哪个函数啊
m_pArr不是被赋值的函数吗,还有arr的m_arr是哪个函数啊
2016-07-03
int main(void)
{
Coordinate* coorArr = new Coordinate[2];
coorArr->m_iX = 1;
coorArr->m_iY = 2;
coorArr++;
coorArr->m_iX = 3;
coorArr->m_iY = 4;
coorArr--;
for(int i = 0; i < 2; i++)
{
coorArr[i].printInfo();
}
delete []coorArr;
coorArr = NULL;
return 0;
}
{
Coordinate* coorArr = new Coordinate[2];
coorArr->m_iX = 1;
coorArr->m_iY = 2;
coorArr++;
coorArr->m_iX = 3;
coorArr->m_iY = 4;
coorArr--;
for(int i = 0; i < 2; i++)
{
coorArr[i].printInfo();
}
delete []coorArr;
coorArr = NULL;
return 0;
}
int main(void)
{
Coordinate*p=new Coordinate[1];
for (int i=0;i<2;i++)
{
p->SetXY(2*i+1,2*(i+1));
p++;
}
for(int i = 0; i < 2; i++)
{
p--;
p->printInfo();
}
p++;
delete[] p;
p=NULL;
system("pause");
return 0;
}
{
Coordinate*p=new Coordinate[1];
for (int i=0;i<2;i++)
{
p->SetXY(2*i+1,2*(i+1));
p++;
}
for(int i = 0; i < 2; i++)
{
p--;
p->printInfo();
}
p++;
delete[] p;
p=NULL;
system("pause");
return 0;
}