|
|
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Mueen Nawaz wrote:
>>> I may be wrong, but I believe all variables declared outside of a
>>> function have default values.
>
>> More exactly, in C at least, any variables allocated statically start
>> with a default value of zero appropriate for their type. That includes
>> static variables allocated inside a function.
>
> It would be interesting to see a quote from the C standard.
http://atrey.karlin.mff.cuni.cz/projekty/vrr/doc/c99.pdf
Section 6.7.8, page 126 (or sheet 138). Check rule 10.
But come on, this has been the case since K&R First Edition. :-)
--
Darren New / San Diego, CA, USA (PST)
Post a reply to this message
|
|