Re:C Legacy Is Evil
by ChrisAntaki on Tuesday November 04, 2014 @04:37PM
(#8559183)
The language just gave you a block of memory. It lets you decide whether you'd like to dedicate resources to clearing that memory.
[ Parent
| on HN ]
Ok, so for what is usefull to have garbage after get memory?
Why do I need to zero an image array if I am about render something into it? You spend time setting each byte to zero.
Re:C Legacy Is Evil
by JoeAltmaier on Tuesday November 04, 2014 @05:35PM
(#8559476)
That, and when your constructor is going to initialize every field, and when you're going to clone a copy of another structure...
I understand if I get null/empty... but garbage?
And in relation to this post, the behaviour is not the same across compilers/archs? Thats nuts.
Re:C Legacy Is Evil
by notacoward on Tuesday November 04, 2014 @06:08PM
(#8559627)
Welcome to programming in the real world. If that's the nuttiest thing you have to deal with on any given day, it's a good day.