From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert P. J. Day" Subject: weird structure definition in header file Date: Tue, 6 Sep 2005 15:13:48 -0400 (EDT) Message-ID: Mime-Version: 1.0 Return-path: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: C programming list i'm looking at some legacy code and, in a header file, i find the following (paraphrased for brevity): typedef struct { ... stuff ... } Widgets ; extern Widgets Widget ; huh? i can see why a header file would want to define a structure but i'm confused why the *header* file would then refer to an external object of that type. that's a new one on me -- typically, i'd expect a *source* file to define such a thing and other *source* files to contain the "extern" declaration. is this some subtle programming cleverness of which i am unaware? thanks. rday