Re:The Descent to C (2013)
by Zababa on Friday September 03, 2021 @06:30PM
(#28410135)
This is actually a really good way to drive home that arrays don't really "exists" in C and are just syntaxic sugar for pointer arithmetic.
[ Parent
| on HN ]
Re:The Descent to C (2013)
by kevin_thibedeau on Friday September 03, 2021 @10:20PM
(#28411512)
They exist in the sense that their length is sometimes known if the full definition is visible. sizeof(array) isn't the same as sizeof(generic ptr to array).
This is not entirely a complete view. For example, sizeof() operator returns the declared size of an array. It seems that C recognizes the concept of an array.
"Because real programmers only need void*".
There's a language for that https://github.com/kyouko-taiga/void-lang