POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 05:12:13 EDT (-0400)
  Re: C++ questions  
From: Slime
Date: 25 Sep 2008 01:25:12
Message: <48db20b8@news.povray.org>
> 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.


I was under the impression that global variables are initialized to zero, 
but you can't trust local variables because the stack has whatever garbage 
data was left on it from previously called functions.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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