What would be better practice when giving a function the original variable to work with:
unsigned long x = 4;
void func1(unsigned long& val) {
val
Pointers:
nullptr
(or NULL
).&
if your type is not a pointer itself,
making explicitly you are modifying your object.References:
&
. This is considered sometimes
bad because you must go to the implementation of the function to see if
your parameter is modified.