In all the code I've seen as of today, the * has always been associated to the variable instead of the type: char *pc; I would have expected (and I tend to write): char* pc; I know the first syntax is correct because char *pc1, *pc2; //works char* pc1, pc2; //does not work It may seem futile
That is a common mistake made by lots of people I knew When a user declare somthing like char* pc1,pc2; It does not mean that both pc1 and p2 are declared as pointer. Only pc1 is declared as pointer but not pc2. pc2 is just a char type variable. char* pc1, pc2; char *pc1, pc2; both are same.