Should *'s go next to the type or the variable name? [closed]
- by derekerdmann
Possible Duplicate:
int* i; or int *i; or int * i;
When working in C or C++, how should pointers be declared? Like this:
char* derp;
or this:
char *derp;
I typically use the first method, because the variable is a character pointer, but I know that it can create confusion when declaring multiple variables at once:
char* herp, derp;
herp becomes a character pointer, while derp is just a character.
I know it often comes down to coding style, but which one is "better?" Should I sacrifice clarity to eliminate potential confusion?