Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site harvard.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!draves From: draves@harvard.UUCP (Richard Draves) Newsgroups: net.lang.c Subject: Re: structure references in header files Message-ID: <550@harvard.UUCP> Date: Thu, 12-Dec-85 12:27:36 EST Article-I.D.: harvard.550 Posted: Thu Dec 12 12:27:36 1985 Date-Received: Sat, 14-Dec-85 07:54:46 EST References: <547@brl-tgr.ARPA> <2528@umcp-cs.UUCP> Reply-To: draves@harvard.UUCP (Richard draves) Organization: Aiken Comp Lab, Harvard Lines: 25 In general it is important to include the 'forward declaration': struct a; struct b { struct a *pa; }; struct a { struct b *pb; }; This makes a difference when the declarations are inside a scope that already can see a definition of 'struct a'. For instance, struct a { ... }; main() { struct b { struct a *pa; }; struct a { struct b *pb; }; ... } does not do what one might expect. Rich -- "a picture in the head is a gory murder in an art gallery" -- Stephen Kosslyn