3 ms·
What's weird is five hours after asking that question, no one has provided a reasonable explanation of why C requires arrays to become pointers on function boun
by acconsta 11y ago
What's weird is five hours after asking that question, no one has provided a reasonable explanation of why C requires arrays to become pointers on function boundaries.
My "online search" found Walter Bright, who knows a thing or two about C compilers, wondering the same thing:
https://news.ycombinator.com/item?id=7572011 https://news.ycombinator.com/item?id=7572011
- 36erhefg 11y agoImprove your searching capabilities. https://programmers.stackexchange.com/questions/245602/why-cant-arrays-be-passed-as-function-arguments-in-c https://programmers.stackexchange.com/questions/245602/why-c... ( https://stackoverflow.com/questions/7454990/why-cant-we-pass-arrays-to-function-by-value https://stackoverflow.com/questions/7454990/why-cant-we-pass... ) And partially this thread. As for Walter; Stop using C like you want it to be used, and instead how it is meant to be used. The article takes a strawman position. Anyone who takes their time and learns C, knows that arrays decay.
- acconsta 11y agoSo it comes down to historical compatibility with B? Wow.