如上所述,这样做有什么棘手的方法吗? 由于您无法传递数组,我想知道如何将坐标(x / column和y / row)返回给调用对象。 问候。
答案 0 :(得分:0)
c ++中有很多可能,但我给你一个简单的例子:
struct coords {
int x;
int y;
};
int calculate_value_of_x(int y);
int calculate_value_of_y(int x);
coords calc_coords() {
coords c;
c.x = calculate_value_of_x(c.y);
c.y = calculate_value_of_y(c.x);
return c;
}