Although, considering you have various types your function needs to return I would suggest user defined type to be stored in the vector you return from function.
#include <iostream>
void f(int& x, int& y, int& z)
{
x = 1;
y = 2;
z = 3;
}
int main()
{
int a;
int b;
int c;
f(a, b, c);
std::cout << a << ' ' << b << ' ' << c << std::endl;
}
i can't use refernce in my program cox i have to pass a 2nd outer function through 1st outer funtion than i will call 1st outer funtion in main funtion peter87's approach isn't helpful. moorecm and peter87
+1 to Peter87.
-1 to those suggesting globals or tuples.
Why would you suggest a tuple to somebody who has never heard about pass by reference or vectors?
Why not? (One shouldn't forget persons other than the OP may glean information from this thread in the future.)
What score do you give people who did nothing but rate other people in this thread?
On topic: Speaking of tuples and ever more options, you could go the simple route and just define a type (read struct) which could hold all of the values you want to return and return that.