back

by uecker·3y ago·view on hn ↗
If you code them by hand, then yes. If you a library, then it is the same.

It is certainly true that the C++ standard library provides more functionality out of the box.

1 comments
Almost any C library function that deals with strings is going to be more complex to use due to the lack of automatic memory handling, necessary for any use case where the max. size isn't sufficiently well-known at compile time for it to sit on the stack. I'd accept something like "atoi" or "strtol" is pretty simple to use (and hard to get wrong), but hardly win any awards for obviousness. And the less said about the need (or at least strong tendency) to use sscanf for more complex parsing (hexadecimals etc.), the better.
A library can do the memory management for you:

string a = string("test"); string b = string(" this"); string n = string_concat(a, b); ...