Lets say we have the following code that doesn't use references:
int val = 5;
int val2 = func(val);
int func(int v) {
return v * v;
}
Would the code be better with using references? I understand the difference between pointers and references, but not when to use references as opposed to not use them.