Initializing Static Variables

Dave P. Schaumann dave at cs.arizona.edu
Tue Feb 26 13:32:14 AEST 1991


In article <1991Feb26.014801.29244 at athena.mit.edu> scs at adam.mit.edu writes:
>In article <13704 at hacgate.UUCP> wdelv at devnet3.UUCP (walt del vecchio) writes:
>>[what's the value of an uninitailized static var?]
>
>[static vars are 0, auto vars are random]

Interesting.  I'm just working out "Dave's law of variable non-useability":

	An uninitialized variable can be counted on to have a random
	value, until such time as a random value will be useful to
	the programmer.  Then, an uninitialized variable can be counted
	on to be zero.

(for the humor impaired, re-read with ";-)" mode on...)

-- 
Dave Schaumann      | Is this question undecidable?
dave at cs.arizona.edu |



More information about the Comp.lang.c mailing list