Yes. UNIX vs. Windows vs. Linux. Read those standards documents if
you want to know why.
As far as I know, none of those operating systems guarantees that
uninitialised stack variables will be zero.
Some of them may guarantee that the stack initially contains zeros,
but as I pointed out in another article they will not necessarily
still be zero by the time a user function is called.[/QUOTE]
To clarify, the stack may _initially_ contain all zeros, or a specific
value, when the program is started. That is up to the individual OS's,
and may be found in the documentation. However, whether automatic
variables are initialized is not up to the OS (I don't think it can be
up to the OS). It may be up to the processor, for example, on systems
where a function entry assembler instruction exists. It is up to the
compiler, possibly allowing for different setings. This would (should)
be found in the documentation for each compiler.
Cheers,
--Marty Amandil