#include <stdio.h>
struct node_s {
private:
int x;
int y;
public:
node_s(int x, int y)
{
this->x = x;
this->y = y;
}
friend void print(node_s &p);
};
void print(node_s &p)
{
printf("p.x: %d, p.y: %d\n", p.x, p.y);
}
int main(int argc, char* argv[])
{
node_s node(1, 2);
print(node);
getchar();
return 0;
}
时间: 2024-10-12 13:08:25