When pass a variable to a function, why the function only gets a copy/duplicate of the variable?
int n=1; void foo(int i) { i++; }
As
Depending on what you're trying to do, you can do this:
int n = 1; n = foo(n);
int n = 1;
n = foo(n);
Just make sure foo(int i) returns i after modifying it.