Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: typedefs that need each other Message-ID: <14826@smoke.brl.mil> Date: 11 Jan 91 23:11:22 GMT References: <26261@uflorida.cis.ufl.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <26261@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes: >typedef struct _struct1 { > STRUCT2 *structure; >} STRUCT1; >typedef struct _struct2 { > STRUCT1 *structure; >} STRUCT2; You cannot use an identifier as a typedef before the identifer IS a typedef! However, you can use incomplete types in contexts such as this. For instance: struct _struct2; /* optional in most cases, but recommended */ struct _struct1 { struct _struct2 *structure; }; struct _struct2 { struct _struct1 *structure; }; typedef struct _struct1 STRUCT1; typedef struct _struct2 STRUCT2;