On Tue, 22 Mar 2016 09:58:52 -0400
Adam Devita <adevita at verifeye.com> wrote:

> I don't know the reasoning, but it seems that VS6 often
> initialized things to 0xcd in debug mode and (usually) had memory
> uninitialized to 0x00 when complied in Release (perhaps 0x00 just
> happens to be what was on the stack or heap).  

I would be talking out of school here if you're talking about C#.  For
C and C++, the 0xcd initialization helps make (mis)use of uninitalized
objects more obvious.  If the allocated buffer happens to be
zero-initialized, things like printf will make them appear empty when
they're actually invalid.  

This link has a nice discussion: 

        
http://stackoverflow.com/questions/2769247/controling-crt-memory-initialization

and includes a link to the documented behavior: 

        https://msdn.microsoft.com/en-us/library/Aa270812

--jkl

Reply via email to