Re: Can I assume uninitialized variable's value to be nil or 0?
Re: Can I assume uninitialized variable's value to be nil or 0?
- Subject: Re: Can I assume uninitialized variable's value to be nil or 0?
- From: Greg Herlihy <email@hidden>
- Date: Thu, 18 May 2006 20:01:24 -0700
- Thread-topic: Can I assume uninitialized variable's value to be nil or 0?
Yes, all global variables are zero-initialized as are all statically
declared variables at both file and function scope. (Of course static
variables declared within a routine retain their value between calls and are
therefore initialized only once - and not until the function is invoked for
the first time.)
Greg
On 5/18/06 3:12 PM, "John Stiles" <email@hidden> wrote:
> On May 18, 2006, at 2:55 PM, Scott Ribe wrote:
>
>>> All
>>> other variables follow standard ANSI C initialization rules.
>>
>> Which means mostly not initialized, but file-scoped statics are
>> zeroed...
>
> Aren't statics of any scope zeroed (or constructed on first use for
> [Objective-]C++)?
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden