Aaron Ardiri wrote:
> typedef struct
> {
> int a;
> } MyStruct, *MyStructPtr;
At the risk of starting a religious war, I have to ask: why do people
(including the writers of the Palm header files) create typedefs for
pointers? I find it simpler, cleaner and easier to read if I just say
MyStruct *p;
rather than
MyStructPtr p;
In the latter case, it's not as clear that the thing you're defining is
a pointer; the type name is longer and not as transparently related to
the base type MyStruct; and there are twice as many typedefs floating
around. I can understand doing something like this if you're defining
an opaque type that isn't meant to be dereferenced (or, heaven forbid,
you're working on some horrible segmented architecture where you've got
to distinguish between near/far pointers), but I've seen people do this
for ordinary pointers that are meant to be dereferenced. Why?
--Mark