Is it generally considered better to pass parameters as pointers rather than as value when you can? Obviously it largely depends on the situation, but when there is a choice, is it better to use pointers?
Is this simply for reasons of memory?
And what is better to pass through if it is true, a pointer or a reference?
Some general rules of thumb:
If you need to modify it, pass a pointer or a reference. If the value might be null, pass a pointer, otherwise pass a reference.
If it’s large, pass a const pointer or const reference, depending on whether null is a legal value.
If using pointers, prefer smart pointers to bare pointers.
Otherwise, pass by value.