This is completely preference, but I like to keep it near the type when I declare a variable or specify a parameter. Thus, when I refer to a variable and use &my_variable, I just know that it is a reference to a variable and has nothing to do with the declaration. I do the same with pointers. I declare them int* ptr;, so when I see *ptr, I know that it just dereferences him.
source
share