a simple C++ question
Anyone know what means if got a '&' after the variable
in the function???
when i read the book , it's said pass the variable by reference, but i still not understand that!!
so anyone can explain to me and give me some example??
an & before a variable suggests its actual address.
call by reference means that if any change in value is done to the variable passed in the functon then it will be a permanent change.
void func1(int &a, int b)
now if in main() you display value of a it will be +1 but b will remain as the original val.
int A, B, C;
void mystery(int D,int& E, int C)
so is that A=2 (unchange)
and the output is 11
is that correct??
i just found the question from my tutorial!!
Thanks a lot