I have problems with links. Consider this code:
void pseudo_increase(int a){a++;} int main(){ int a = 0;
Here the value of the variable a does not increase, since the clone or its copy is transferred, and not the variable itself.
Now consider another example:
void true_increase(int& a){a++;} int main(){ int a = 0;
It says that the value of a will increase, but why?
When true_increase(a) is called, a copy of a will be passed. This will be another variable. Consequently, &a will be different from the true address of a . So how does the value of a increase?
Correct me where I am wrong.
source share