When to use pass by reference

Hello!

In the program on page 73, two pointers are used to pass value. I was wondering if someone could explain to me why you used two pointers pass value instead of using one pointer to pass value and having the function return a value. I understand functions can only return one value, but is it better to use pointers to pass value?

Thanks!