I'm coming from C and I've learnt that if we pass an argument to a function it'll only make a copy of it with it's value so if we change this variable value the variable that was passed to the function won't change because they're obviously 2 different variables with 2 different addresses just with the same value. So in C if we would want to change a parameter that is being passed to a function we would pass a pointer with the parameter address.
Now, in c++ we could do the same, but we could also do this :
void changeValue(int& n)
{
n = 10;
}
Not only that we're not de-referencing to assign a value but when we pass the variable to the function we pass it as is without the address (&) operator. So I don't understand what is the difference here ? If we don't de-reference is it even a pointer ? Also if we pass it as is without the & operator how is it that we pass it by reference ? Could someone clear some things for me ?