News for hackers. Stuff that matters.
Re:C’s Biggest Mistake (2009) by erik_seaberg on Sunday September 13, 2020 @02:11AM (#24458781)
The weird thing is that the compiler obviously knows how to copy an array, because you can pass a copy of a struct that contains an array. I have a vague impression that early versions of C couldn't pass either structs or arrays, only scalars and pointers.
Re:C’s Biggest Mistake (2009) by hvdijk on Sunday September 13, 2020 @06:14AM (#24459799)
You are correct. This is briefly mentioned on https://www.bell-labs.com/usr/dmr/www/chist.html:

> While [the first edition of K&R] foreshadowed the newer approach to structures, only after it was published did the language support assigning them, passing them to and from functions, [...]