Do you prefer 'int ptr' or 'int ptr'?
This is a style question.
With pointers and references, do you put the symbol next to the type or the name?
On one hand, I can see putting it with the type, since the type is 'a pointer to an int.'
But I can also see it leading to bugs. For example, when trying to declare two such pointers:
int* a, b; // This creates a pointer to an int and an int.
(Note: I know it isn't good practice to not initialise, but it's just an example)
So, what is the predominant wisdom on this issue? Which do y'all use and why?
https://redd.it/1q08le3
@r_cpp
Post #24599
20