Ronald G Minnich wrote:

> On Sun, 13 Jan 2002, Jan Kok wrote:
> 
> 
>>a) who says member names can begin with "."?  I don't see it in The C
>>Programming Language, 2nd Ed. by K&R, and I don't see it in the
>>extensions listed in the gcc documentation (although it mentions that
>>"$" is allowed as an extension).
>>
> 
> This is a new Coke thing. Now allowed.
> 
> 
>>b) I also don't see where
>><member>=<value> is allowed for initialization.  The standard way is {
>><value>, <value>...}
>>
> 
> no, that's allowed to. It's much more reliable than the old "standard
> way".
> 
> Both of these things ensure that your initializations will work even if
> (1) the order of structure members is changed or (2) new structure members
> are added.
> 
> ron
> 


 From ANSI+ISO+IEC+9899-1999 Standard Section 6.7.8 page 130

        EXAMPLE 10 Structure members can be initialized to nonzero
        values without depending on their order:
                div_t answer = { .quot = 2, .rem = -1 };

Ollie

Reply via email to