News for hackers. Stuff that matters.
Re:How to C in 2016 by to3m on Friday January 08, 2016 @10:27AM (#10865491)
When you replace the initialiser with 1, it should only initialse the first element to 1. Objects initialized in this way have unmentioned elements set to 0 or NULL (recursing into aggregates, initialising the first named union member). (See C11 standard, 6.7.9.21. 6.7.9.10 gives the rules for selecting the default value. Aside from the extra syntax, I don't think the rules differ substantially from C89...)

C++ lets you do "uint32_t array[10]={}", which is something C should allow as well, really. But it doesn't.

There are no comments on this comment yet.