Hacker News new | ask | show | jobs
by Arnavion 3820 days ago
>Does not initialise every element to 0 in the way it would seem to.

Yes it does, since atleast C99. As for the others:

a) Removing the initializer will leave the values undefined.

b) Using an initializer of { 1 } will initialize the first element to 1 and the rest to 0.

1 comments

"the way it would seem to"

{} initialises all elements to 0.

{0} initialises the first element to 0 and the rest to 0.

The latter form just introduces confusion.