Introduction
C++ has two strings representations:
- one inherited directly from C (the book refers to these as cstrings)
- and a class string from the Standard Library
For the moment we’ll focus on cstrings (but will return after introducing classes to present the C++ string class)
The basic idea behind cstrings is that a string is nothing more than an array of characters
However, unlike our previous use of arrays, instead of passing around an array’s actual and maximum size we’ll indicate the end of an array with the sentinel value ‘\0’ and place the burden of ensuring sufficient space on the programmer