3 ms·
Be interesting to see when these features showed up. I learned C from the K&R book back in the day and it doesn't mention most of these. Designated initializer
by zwieback 4y ago
Be interesting to see when these features showed up. I learned C from the K&R book back in the day and it doesn't mention most of these.
Designated initializer is something I'll try to remember, seems handy.
- suprjami 4y agoDesignated initialisers were added in C99
- AceJohnny2 4y agoYeah the K&R, while being a masterpiece of clarity and conciseness, is severely outdated in many important ways. I wish there was some effort to create a modern version while preserving the clarity and conciseness of Kernighan and Ritchie. Designated initializers in particular are extremely useful. I once halted a factory line for days because of a mistake they would have avoided.
- flohofwoe 4y agoDesignated init and compound literals were added in C99. I think there are two reasons for those features not being better known: 1) C++ 'forked' their C subset before C99 (ca. "C95"), and while C++20 finally got its own version of designated init, this has so many restrictions compared to C99 that it is basically pointless. 2) MSVC hasn't supported any important C99 features until around 2016