I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition.
How about these examples:
int* test;
int *test;
int * test;
int* test,test2;
int *test,test2;
int * test,test2;
Now, to my understanding, the first three cases are all doing the same: Test is not an int, but a pointer to one.
The second set of examples is a bit more tricky. In case 4, both test and test2 will be pointers to an int, whereas in case 5, only test is a pointer, whereas test2 is a "real" int. What about case 6? Same as case 5?
You can think of 4, 5, and 6 as follows: declaring the type only has to be done once, but if you want to declare a pointer to that type (by adding an asterisk) you have to do so for each variable.
When declaring a pointer variable, I always add whitespace between the variable and asterisk, even if I'm declaring more than one in a line. Not doing so makes me confuse it for a dereferencing expression nearly every time.