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.
Asked
Active
Viewed 363 times
0
-
How about a structure? – Some programmer dude May 16 '15 at 23:09
-
There is even a structure called array, to get you confused ;-) – Marc Glisse May 16 '15 at 23:10
-
1You could even use an std::pair to leverage things already in the standard library – user1646196 May 16 '15 at 23:11
1 Answers
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