> 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
|