Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!ur-helheim!dave From: dave@ur-helheim.UUCP (Raver Dave) Newsgroups: net.lang.c Subject: Re: Structure initialization rules question Message-ID: <657@ur-helheim.UUCP> Date: Thu, 22-May-86 13:07:18 EDT Article-I.D.: ur-helhe.657 Posted: Thu May 22 13:07:18 1986 Date-Received: Sun, 25-May-86 11:47:39 EDT References: <696@moscom.UUCP> Reply-To: dave@helheim.UUCP (Raver Dave) Distribution: net Organization: U. of Rochester, EE Dept. Lines: 18 In article <696@moscom.UUCP> noemi@moscom.UUCP (Noemi Berry) writes: > > Why is it that you can only initialize structures when they are global > (outside of main() )? >noemi berry >{allegra|decvax|seismo}!rochester!moscom!noemi >"On a souvent besoin de plus petit que soi" K&R p120 (as in the index): "An 'external' or 'static' structure can be initialized by... a list of initializers for the components." So the 'reason' is most likely that this initialization occurs at compile time and not at runtime, since the latter could be very costly. Raver Dave