Note: This question is about the position of the asterisk (*).
In most C code I see (e.g., in Beej\'s guide to network programming), all variable declar
From Stroustrup's C++ Style and Technique FAQ.
A "typical C programmer" writes
int *p;and explains it "*pis what is theint" emphasizing syntax, and may point to the C (and C++) declaration grammar to argue for the correctness of the style. Indeed, the*binds to the namepin the grammar.A "typical C++ programmer" writes
int* p;and explains it "pis a pointer to anint" emphasizing type. Indeed the type ofpisint*. I clearly prefer that emphasis and see it as important for using the more advanced parts of C++ well.