4 ms·
A C string is a convention, not a type and I don't know why we still cannot get a string type in C that can live side by side with 'char *'. I mean we got wchar
by sovande 15y ago
A C string is a convention, not a type and I don't know why we still cannot get a string type in C that can live side by side with 'char *'. I mean we got wchar_t duct-taped to C so why did the C99 guys not introduce a 'string' type (add/len)?
- daemin 15y agoYou can just do it yourself, typedef char* (or some other fancy array) as a string type and treat the first x bytes as a length of the string. There's nothing stopping people from doing this temselves.