3 ms·
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 cas
by wizofaus 4y ago
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.
- uecker 4y agoA library can do the memory management for you: string a = string("test"); string b = string(" this"); string n = string_concat(a, b); ...