Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!mintaka!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Initializing Static Variables Message-ID: <15330@smoke.brl.mil> Date: 25 Feb 91 21:17:49 GMT References: <13704@hacgate.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 10 In article <13704@hacgate.UUCP> wdelv@devnet3.UUCP (walt del vecchio) writes: >Does the declaration of a static int, for example, establish a variable >with an initial value of zero ? >If so, is it portable ? Variables having static storage duration for which no explicit initializers are specified receive default initial values of zero (of the appropriate type). This has been true of most C implementations on UNIX systems, and is guaranteed for standard conforming implementations. A lot of existing application rely on this feature.