Different ways of "Returning" more than one value from a function
Suppose a function expects void argument and returns an array. But along with returning this array, we also want to pass something else. Lets say for this example some kind of exit status or flag a 1 or 0.
What ways are there to do this?
We could make a structure or array within this function that is composed of word and flag and return that. But that's complex.
static char word[MAX_LENGTH];
We could make the flag a global variable but global variables are deemed a last resort.
We could also pass, to this function, instead of void, a pointer to this flag so that when the function ends, the caller pointer has the value. But this requires unwanted modification to the callers code.
Are there any other ways?