0

As above, any tricky methods to do so? Since you cannot pass an array, I wonder how to return coordinates (x/column and y/row) to the calling object. Regards.

TheTobruk
  • 17
  • 4

1 Answers1

0

There's a number of possibilities in c++ to do so, but I'm giving you a simple example:

 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;
 }
πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190