N00B here. I need to reuse a function's return in other functions. The problem is that the function's return changes every time it is called. How to achieve this?
int FUNCTION1(void)
{
// do stuff
return FUNCTIONRESULT; // return to be reused in other functions
}
int FUNCTION2(void) // <- this must be void
{
// do stuff
int NUMBER = FUNCTION1(); // FUNCTION1's return is reused here but it is not the same value as in FUNCTION3
return WHATEVER;
}
int FUNCTION3(void) // <- this must be void
{
// do stuff
int NUMBER = FUNCTION1(); // FUNCTION1's return is reused here but it is not the same value as in FUNCTION2
return WHATEVER;
}