This is the situation:
int f(int a){
...
g(a);
...
}
void g(int a){...}
The problem is that the compiler says that there is no matching function for call to g(int&). It wants me to pass the variable by reference and g() recieves parameters by value.
How can I solve this?
fandground?int&in the call doesn't mean you are required to passaby reference. It's just showing you the arguments you passed, which areg(lvalue int). Since it cannot express lvalue-ness by means of a type, it showsg(int&)instead.