请问同学们,为什么我把public改成private就运行错误呢?
#include <iostream>
using namespace std;
class Coordinate
{
public:
Coordinate() { } // 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
private:
int m_iX;
int m_iY;
};
#include <iostream>
using namespace std;
class Coordinate
{
public:
Coordinate() { } // 打印坐标的函数
void printInfo()
{
cout<<"("<<m_iX<<","<<m_iY<<")"<<endl;
}
private:
int m_iX;
int m_iY;
};
2018-09-01
举报