<cstring>
The <cstring> header is for the C++ version of the C standard <string.h> header, which declares
string-handling functions.
The functions in this section fall into two categories, identified by the first three letters of the function name:
mem. . .The
memfunctions operate on arbitrary chunks of memory, treating the memory as arrays ofunsignedchar. The caller must specify the size of each memory chunk.str. . .The
strfunctions operate on null-terminated character arrays. Even though the function parameters are declared as typechar, they are always interpreted asunsignedcharwhen comparing two characters.
See also <cwchar> for
wide character string functions.
Note
Instead of using C-style, null-terminated character arrays, C++
code should use the string and
wstring classes that are declared
in the <string> header. C++
strings offer high performance, more flexibility, more safety, and
greater ease of use. The char_traits class template in <string> also provides member
functions for working with narrow and wide character arrays.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access