Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!ucsfcgl!cca.ucsf.edu!rk9005 From: rk9005@cca.ucsf.edu (Roland McGrath) Newsgroups: comp.lang.c Subject: Re: struct a <---> struct b Message-ID: <1146@ucsfcca.ucsf.edu> Date: 6 Feb 88 23:30:22 GMT References: <173@heurikon.UUCP> Reply-To: roland@rtsg.lbl.gov (Roland McGrath) Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 21 ["struct a <---> struct b"] - lampman@heurikon.UUCP (Ray Lampman): } What is the best way to declare three different structures, } each containing a pointer to the other two? } I keep running into a forward referencing error. } I'm looking for a solution without typedef's, I'll add those later. } aTdHvAaNnKcSe, Ray. } -- } - Ray Lampman (lampman@heurikon.UUCP) Try: struct a; struct b; struct c; struct a { struct b *bp; struct c *cp; }; struct b { struct a *ap; struct c *cp; }; struct c { struct a *ap; struct b *bp; }; -- Roland McGrath UUCP: ...!ucbvax!lbl-rtsg.arpa!roland ARPA: roland@rtsg.lbl.gov