_Coordinate(int x, int y):m_iX(x), m_iY(y) {
}
int main(void) {
// 在堆上创建对象指针
_Coordinate *p = new _Coordinate(3, 5);
// 打印坐标
cout << "(" << p->m_iX << "," << p->m_iY << ")" << endl;
// 销毁对象指针
delete p;
p = NULL;
return 0;
}
CodeBlocks都过了,在线编译不过,有bug!
}
int main(void) {
// 在堆上创建对象指针
_Coordinate *p = new _Coordinate(3, 5);
// 打印坐标
cout << "(" << p->m_iX << "," << p->m_iY << ")" << endl;
// 销毁对象指针
delete p;
p = NULL;
return 0;
}
CodeBlocks都过了,在线编译不过,有bug!