In the docs it's stated that
You can have more than one return statement in a function.
I have made use of that in my own functions I have written( more than one return), but the final return that gets used is typically based on a conditional set up in the logic of my code.
But it has made me wonder, and too twist the meaning of docs..is there a way to return more than one value from the same return in the function? Like you can similarly with Python?
I know vex syntax structure is very similar to C/C++, and as far as I can remember, something like this is not possible in C ('directly' expressed at least), for C++ I don't have the experience to know.
I've played around with some attempts and at least the following syntax doesn't generate syntax errors, but I don't get any results either. ( confirmed by the default value that gets returned in the printf statement ).
Thanks for anyfeedback/comments.
function int TestReturns()
{
int A, B, C;
A = 5;
B = 7;
C = 8;
return A, B;
}
//*********************
int result_A, result_B;
// default check value;
result_A = 9;
(result_A, result_B) = TestReturns();
printf("return result = %g\n", result_A);