One way to create a pointer type in C would be to declare it using typedef:
typedef int * int_p;
then one can write: int_p p, q, r;
and declare three pointers to int with perfect clarity, whereas using the C++ style, we'd get: int* p, *q, *r;
which is very confusing, or, int* p;
int* q;
int* r;
which is very verbose. I honestly don't know how C++ programmers typically handle this situation.I have seen some code that strikes a middle ground:
int * p;
which is a little more clear, but doesn't address the multiple declarator situation.So why don't C++ programmers use typedef? I don't know, other than I understand Stroustrup doesn't like it (not without reason).
(Edited for formatting and minor clarity corrections.)