2009/7/4 Vitaliy Margolen :
> Static variables are different. They are always initialized to 0. In your
Yes, although perhaps it should be noted that in this particular case
the static storage duration is due to these being global variables,
rather than the static keyword which just specifies inter
On 07/04/2009 11:22 PM, James McKenzie wrote:
> Vitaliy Margolen wrote:
>> James McKenzie wrote:
>>
>>> [code]
>>>
>>> int a = 0;
>>> char b = NULL;
>>> bool c = TRUE;
>>>
>>> [/code]
>>>
>>> Without this, we cannot assume anything.
>>>
>> Static variables are different. They are always ini
Vitaliy Margolen wrote:
> James McKenzie wrote:
>
>> [code]
>>
>> int a = 0;
>> char b = NULL;
>> bool c = TRUE;
>>
>> [/code]
>>
>> Without this, we cannot assume anything.
>>
>
> Static variables are different. They are always initialized to 0. In your
> example you show regular variables
James McKenzie wrote:
> [code]
>
> int a = 0;
> char b = NULL;
> bool c = TRUE;
>
> [/code]
>
> Without this, we cannot assume anything.
Static variables are different. They are always initialized to 0. In your
example you show regular variables only. Their initial value is not defined.
Vitali
Henri Verbeet wrote:
> 2009/6/30 Daniel Santos :
>
>> Some pointers are getting used prior to initialization. It would appear
>> that the current compilers are initializing them to zero or we've been lucky.
>>
>>
> No, the C standard specifies that these are initialized to NULL, since
> t
2009/6/30 Daniel Santos :
> Some pointers are getting used prior to initialization. It would appear that
> the current compilers are initializing them to zero or we've been lucky.
>
No, the C standard specifies that these are initialized to NULL, since
they have static storage duration.
I'm quite sure that C standards guarantee global variables are initialized to 0.
2009/6/30 Daniel Santos :
> Some pointers are getting used prior to initialization. It would appear that
> the current compilers are initializing them to zero or we've been lucky.
>
>
>
>
>
>