Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.lang.c Subject: Re: incomplete types (was: Recursive #includes) Message-ID: <976@philmds.UUCP> Date: 13 Mar 89 19:16:08 GMT References: <570@marob.MASA.COM> <9727@smoke.BRL.MIL> <964@philmds.UUCP> <3804@xyzzy.UUCP> <7488@june.cs.washington.edu> <9804@smoke.BRL.MIL> <1567@ubu.warwick.UUCP> <9842@smoke.BRL.MIL> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 19 In article <9842@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: |There is nothing inherently "bad" about incomplete types, especially |incomplete structure declarations. In fact they are essential for |declaring structures that contain pointers to each other. How essential that is? Consider: struct egg { struct hen { struct egg *eggp; } *henp; }; This declares two structure types, each containing a pointer to the other one. And I can give more complex examples (a nice one is the grammar for the Bourne shell, which can be expressed in these type of recursive data structures: essentially one big struct definition). Leo.