I've been told that I should pass the parameters by reference, but I don't understand what does it change? Since I don't want to alter the content of the vector, but just showing it.
As your code is, it makes a copy of the vector. If the vector is large, the copy can be expensive. Most likely you have been told to pass by const-reference, not just by reference. Passing by const-reference prevents you from changing the vector and it also eliminates the expensive copy.