Introduction
Before I introduce the String, I’ll talk about the C-strings. Every C-string has type *char **. Hence, a C-string references an address in memory; the referenced address is the first of a contiguous set of bytes that store the characters making up the string. The storage occupied by the string must terminate with the special character ‘\0’. The compiler cannot enforce any of these conventions, but any deviation from the rules is likely to cause a run-time error, which is considered not encapsulated.
Now it is easy for us to use encapsulation to embed C-strings into safer class-based implementation in C++. This makes it more convenient, safe, and significantly efficient.