Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
bigfishrunning
10mo ago
0 comments
Save
Share
what changes, in your opinion, would need to be made to the C array type to make it "sensible"? C's array is simplistic, but I don't think it's not "sensible"...
0 comments
3 comments · 2 top-level
top
newest
oldest
nicoburns
10mo ago
· 1 in thread
It would need to store a length and not decay to a pointer when passed to a function.
mgaunard
10mo ago
the length is part of the type.
mgaunard
10mo ago
consider the C++ std::array, which exists to make arrays behave like normal objects.
You can do the same in C by wrapping your array in a struct.
j
/
k
navigate · click thread line to collapse