发布网友 发布时间:2022-04-21 17:41
共1个回答
热心网友 时间:2023-06-20 02:16
灞曞紑鍏ㄩ儴#include <iostream>
using namespace std;
class Coordinate
{
// 鍙嬪厓鍑芥暟
friend void display(Coordinate &coor);
public:
Coordinate(int x, int y)
{
m_iX = x;
m_iY = y;
}
public:
int m_iX;
int m_iY;
};
void display(Coordinate &coor)
{
cout << "m_iX锛?quot; << coor.m_iX << endl;
cout << "m_iY锛?quot; << coor.m_iY << endl;
}
int main(void)
{
Coordinate coor(1,2);
display(coor);
return 0;
}