Andrew Poelstra said:
typedef defines "ME" as a type. #define does a dumb replacement.
There are examples of usage where the two will behave differently,
but I'm too tired to think of one.
Let me help you out. The first one will behave differently by passing
through a compiler unscathed!
Okay, here's a more sensible example:
#define STRING char * /* DANGER, WILL ROBINSON!!!! */
vs.
typedef char *STRING; /* NOT QUITE SO DANGEROUS BUT STILL SCARY */
These will have different effects when the compiler is considering code such
as:
STRING x, y, z;
With the #define you get:
char *x, y, z; /* one pointer, two single chars */
With the typedef you get three pointers, of course.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.