[LCP]Typedef Struct example from Marshall's site

Quang Nguyen (Ngo) quang at tapeware.com
Thu Aug 9 01:53:03 UTC 2001


How about something like this:

typedef struct _tagELEMENT
    {
    int value;
    int anotherValue;
    struct _tagELEMENT *next;
    } ELEMENT;

--
Quang Nguyen (Ngo)


----- Original Message ----- 
From: "Andrew Weaver" <Andrew.Weaver at tecnomen.fi>
To: <linuxcprogramming at lists.linux.org.au>
Sent: Tuesday, August 07, 2001 10:40 PM
Subject: RE: [LCP]Typedef Struct example from Marshall's site


> Don't remember exactly but something to do with "forward declaration of
> struct".
> 
> > -----Original Message-----
> > From: Madhav M. [SMTP:madhav3333 at lycos.com]
> > Sent: Tuesday, August 07, 2001 5:39 PM
> > To: linuxcprogramming at lists.linux.org.au
> > Subject: RE: [LCP]Typedef Struct example from Marshall's site
> > 
> > 
> > Ya, it works for following decl. 
> > struct ELEMENT *next;
> > 
> > Hey, but i'm not getting, how it resolves reference for
> > struct ELEMENT at the above line?
> > --
> > 
> > On Tue, 7 Aug 2001 09:13:30   
> >  Andrew Weaver wrote:
> > >Yeps, seen something like this before. Try 
> > >
> > >typedef struct {  int value;
> > >    struct ELEMENT *next;
> > > } ELEMENT;



_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp




More information about the linuxCprogramming mailing list