求大神, c++的问题
friend ostream& operator << (ostream &out, const Coordinate &coor);
ostream& operator << (ostream &out, const Coordinate &coor)
{
out << coor.m_iX << ", " << coor.m_iY;
return out;
}
已声明为友元, 还是无法访问m_iX, m_iY。 这里报错 无法访问私有成员
friend ostream& operator << (ostream &out, const Coordinate &coor);
ostream& operator << (ostream &out, const Coordinate &coor)
{
out << coor.m_iX << ", " << coor.m_iY;
return out;
}
已声明为友元, 还是无法访问m_iX, m_iY。 这里报错 无法访问私有成员
2017-03-26
举报