int my_fun(int a, int& b, int c) {
a = 2 * a + b;
b = c;
cout << "In my_fun, a=" << a << " b=" << b << ".\n";
return a % 2;
}
int main() {
int x = 1;
int y = -2;
int z = 3;
x = my_fun(x, y, z);
cout << "In main, x=" << x << " y=" << y << " z=" << z << ".\n";
Return 0;
}
Firstly you should usually post errors rather than just code, but as it will just run in the shell then I had a look and you have to include iostream in order to use cout (and put std:: before it). Also C++ is case sensitive and all keywords (such as return) are lower case.
You're compiler should output an error if it fails to compile. When running it in the shell, the only changes I had to do to make it run were to put #include iostream before anything, put std:: before all uses of cout and to replace Return with return.
If there is a logic error then you can't know unless you know what the program is meant to do. I don't know this because I don't have access to wherever you got the function from. Also syntax errors count as errors, the most likely thing for it to be talking about it the Return but the others are valid errors.