Arguments inside a swap function

So I was reading theory on pointers, specifically pass by reference and in that there was example of swap function. But when we made the sort programs, like the bubble sorting, we probably passed the argument by value and not by reference and the program worked, but according to the theory it ought to have been passed by reference.

The image of the theory is attached below and also the link to the program which i am referring to.

Okay so i read the theory further and i found out that we need not put the ampersand sign in the source code because the compiler takes care of it in c++. Have I got it right now?t

yes , see this, both ref and val work