3 ms·
> There's no particular reason why C doesn't allow you to assign one array to another of the same length Actually, there is a particular (though not necessaril
by a1369209993 4y ago
> There's no particular reason why C doesn't allow you to assign one array to another of the same length
Actually, there is a particular (though not necessarily good) reason, since that would require the compiler to either generate a loop (with conditional branch) for a (unconditional) assignment or generate unboundedly many assembly instructions (essentially a unrolled loop) for a single source operation.
Of course, that stopped being relevant when they added proper (assign, return, etc) support for structs, which can embed arrays anyway, but that wasn't part of the language initially.
- pjmlp 4y agoIt was initially available in 1982, so plenty of time to add the other features. https://www.bell-labs.com/usr/dmr/www/chist.html https://www.bell-labs.com/usr/dmr/www/chist.html