POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
10 Oct 2024 04:42:16 EDT (-0400)
  Re: C++ questions  
From: Darren New
Date: 24 Sep 2008 19:27:19
Message: <48daccd7$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.