need help with pointer homework my return statement isnt working and i cant find in my textbook a good example on how to do it.
Problem is: the following function uses reference variables as parameters. rewrite the function so it uses pointers instead of reference variables and then demonstrate the function in a complete program
int doSomething(int &x, int &y)
{
int temp =x;
x = y *10;
y = temp * 10;
return x + y;
}
In the first case the order of evaluation of function arguments (arguments of operator << ) is undefined. So as arguments are usually evaluates from right to left x and y have values before calling doSomething the second time.