--- John Matthews <[EMAIL PROTECTED]> wrote:
> --- In [email protected], Ray Devore
> <[EMAIL PROTECTED]> wrote:
> >
> > I keep seeing two different ways to define a
> struct
> > (see below). What is the benefit of doing the
> typedef
> > over just defining the struct with a tag?  Is one
> more
> > efficient than the other?
> 
> The run-time efficiency isn't going to change, and
> I'm not sure about
> C++. But in C the typedef without tag creates an
> unnamed structure,
> and I've used C compilers in the past which only say
> 'error in
> unnamed' if they detect a related error.
> 
> You can always use a typedef and a tag eg.
> 
> struct tag_T { ... };
> typedef struct tag_T T;
> 
> or
> 
> typedef struct tag_T { ... } T;
> 
> John
> 
But why use one over the other?

Ray 



 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

Reply via email to