10.7. Characters and StringsΒΆ

Since C++ is an extension of C, standard C style null terminated character array strings work as always with the string.h include file.

C++ also has a native string class. The same C string functions are supported with the string class with the cstring include file. Namely, cstring includes: srcpy, strncpy, strcat, strncat, strcmp, strncmp, strlen.

Strings may be initialized as empty, from a constant string, from a C char string or from another C++ string class. The string object, has a number of methods and overloaded operators.