2 ms·
I had sort-of forgotten about those. len needs to be explicit unless it's packaged as eg arr.len. Also (* arr)[i] is just as unacceptable as (* p).item, but yo
by a1369209993 8y ago
I had sort-of forgotten about those.
len needs to be explicit unless it's packaged as eg arr.len. Also (* arr)[i] is just as unacceptable as (* p).item, but you can't do arr[i] unless you abandon the ability to do indexing on raw pointers, which would break essentially all of C.
- caf 8y agoThe length doesn't really need to be explicit because it's available through sizeof, although I guess that having to divide by the element size makes that a little inconvenient. Maybe you could do something like arr->[i] as sugar for (*arr)[i]?