Maybe my memory has gone completely wacko, but I think I remember that declaring pointers without initializing them made them point to nil. But recently this doesn't seem to be the case. Has it always been this way? Or has it something to do with the compiler settings?
Instance variables of objects are initialized to nil
in alloc
(the whole object is bzeroed).
Edit: Also, global and static storage variables are initialized to zero (6.7.8 10 of the C99 Standard, thanks Derek for pointing that out).
Local stack variables are not initialized automatically. This did not change in known history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With