I couldn't find cstring methods on that page.
Seems misleading since strlen() does not work with cstring, one must use
|Seems misleading since strlen() does not work with cstring, one must use|
No strlen() requires a C-string while x.length() would require a std::string. The <cstring> header defines functions used to operate on C-strings, while <string> defines the C++ string class.
Also the <string.h> include is the C standard header and <cstring> is the C++ standard header that provides the same functions as <string.h>
Last edited on
Oh, yes. I see now.
My mistake was just that, using <cstring> thinking that was the header for c++ strings.
Should have used <string>.