Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!hao!cires!nbires!ut-ngp!lee From: lee@ut-ngp.UUCP Newsgroups: net.lang.c Subject: Re: Array Initialization - (nf) Message-ID: <413@ut-ngp.UUCP> Date: Fri, 8-Jul-83 16:02:29 EDT Article-I.D.: ut-ngp.413 Posted: Fri Jul 8 16:02:29 1983 Date-Received: Sat, 9-Jul-83 19:06:09 EDT References: pur-ee.953 Lines: 11 All globals and statics in C are initialized to zero. Globals are identifiers declared outside of any function without a storage-class specifier. This is part of the C definition and all C compilers should guarantee this. Auto identifiers are typically not initialized (you should definitely not expect them to be) because they are allocated on the stack and disappear every time you leave a function and are created every time you enter the function. This is also why most C compilers don't allow you to initialize autos. If you allow auto initialization, then your C compiler must generate code that assigns the correct value to the auto upon every entry to the function. It's usually cheaper to explicitly do the assignment yourself.