Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site rabbit.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!eagle!allegra!alice!rabbit!ark From: ark@rabbit.UUCP Newsgroups: net.lang.c Subject: Re: typedef in c Message-ID: <2300@rabbit.UUCP> Date: Sat, 17-Dec-83 10:07:08 EST Article-I.D.: rabbit.2300 Posted: Sat Dec 17 10:07:08 1983 Date-Received: Sun, 18-Dec-83 06:16:59 EST References: <319@aecom.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 23 Original query: Why doesn't this work: typedef struct { newtyp *link; } newtyp; Answer: C is, in effect, a language designed to be parsed in a single pass. In the example above, the compiler doesn't even know yet that "newtyp" is a type the first time it encounters it, so it can't parse it. The following will work, though: struct newtyp { struct newtyp *link; }; or even: typedef struct foo { struct foo *link; } newtyp; because in each case there are no forward references necessary to work out the meaning of an identifier.