3 ms·
> misinterpret the meaning of a variable named `size` Quite right. I use, and highly recommend, the convention that `size` is for number of bytes, `length` is
by WalterBright 6y ago
> misinterpret the meaning of a variable named `size`
Quite right. I use, and highly recommend, the convention that `size` is for number of bytes, `length` is for number of elements, and `capacity` for the allocated number of elements.
assert(length * sizeof(element) == size);
assert(length <= capacity);