4 ms·
>See? The language PUT GARBAGE on your code. It didn't put it there. It just allocated some memory. Not more, not less. If you, for example, malloc a large chu
by thegeomaster 12y ago
>See? The language PUT GARBAGE on your code.
It didn't put it there. It just allocated some memory. Not more, not less. If you, for example, malloc a large chunk of memory but don't intend to use it sequentially or not right away, you can save time by not memset'ing it to zero, which would be pointless. C gives you the liberty to defer the initialization, but if you're careless, you'll shoot yourself in the foot. It's very much like having a car with manual vs. automatic transmission. More power = more responsibility. If you need power, you have to accept some compromises, and in this case, the compromise is that you need to mind what's in your memory all the time.