Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!chad From: chad@csd4.csd.uwm.edu (D. Chadwick Gibbons) Newsgroups: comp.lang.c Subject: Re: Struct definition in MS-C Message-ID: <3925@csd4.csd.uwm.edu> Date: 21 Aug 89 14:47:44 GMT References: <680010@hpmwjaa.HP.COM> <1575@dsacg3.UUCP> Sender: news@csd4.csd.uwm.edu Reply-To: chad@csd4.csd.uwm.edu (D. Chadwick Gibbons) Organization: University of Wisconsin-Milwaukee Lines: 18 In article <1575@dsacg3.UUCP> nts0302@dsacg3.UUCP (Bob Fisher) writes: |From article <680010@hpmwjaa.HP.COM>, by jeffa@hpmwtd.HP.COM (Jeff Aguilera): |#> struct node { |## struct node *next; |## }; |## as it is with standard C, but this doesn't work with MS-C. |I doubt it. struct node cannot include itself in its own definition. ..but it can indeed contain a pointer to itself. This is a valid C construction, and is mentioned fairly early in the "Structures" chapter of K&R. Without this, data structures such as b-trees would be impossible. struct _btree { char *datum; struct _btree *left, *right; }; -- D. Chadwick Gibbons | Internet: chad@csd4.csd.uwm.edu