Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

size or length

Name: Anonymous 2011-05-14 16:09

Hm.

Name: Anonymous 2011-05-15 7:21

For arrays, I generally use size or count, as it's the preferred nomenclature in C and C++, except with amateur programmers who like to suffix everything with _len.

However, for strings, size/count refers to the number of code-units, and length refers to the number of code-points.

With UTF-8, for example, the size of the string is the number 8-bit octets, and the length of the string is the number of actual characters the encoded string represents. Therefore it holds that length <= octets.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List