I was reading on pointers in a PDF I found on the tubes, and I noticed that a code example uses pointers to do a pass by reference.

In C++ I last spring, when we wanted to pass a value by reference, we used int& someVar; for the variable in the parameter. The PDF uses int* someVar; instead. As far as I know, they do the same thing with no extra abilities given / taken from each one. Which is the more common, or preferred method?

Also, are pointers just like reference variables but involving two named variables (pointer, pointee), and not constricted to a parameter, or is there more?


M.