So, I have an assignment that I need help on. I am given the code for a function called foo() and a function called recover(). I am unable to alter the code for foo, and recover cannot have any arguments, and returns nothing.
The goal of this is to have recover grab the local variables from foo and print them out.
Example:
long foo(long a, long b, long c, long d, long e){
long x, y, z;
if(e < 0)
{
recover();
return a;
}
//do various things with a, b, and c, and store in x, y, and z respectively
return foo(x,y,z,d+1,e-1)+a+b+c+d+e;
}
void recover(void)
{
//What goes here to get the values?
}
What recover() is supposed to do is get the a,b, and c value from EACH call of foo() and print it out. I also know that global variables aren't allowed for this problem.
Thanks for any assistance with this problem.