String Classes

Most C++ compilers come with a class library that includes a large set of classes for data manipulation. A standard component of a class library is a String class.

C++ inherited the null-terminated string and the library of functions that includes strcpy() from C, but these functions aren't integrated into an object-oriented framework. A String class provides an encapsulated set of data and functions for manipu lating that data, as well as accessor functions so that the data itself is hidden from the clients of the String class.

If you are not using the compiler that came with this book, the compiler you are using might not provide a String class; and perhaps even if it does, you might want to write your own.

At a minimum, a

Get Sams Teach Yourself C++ in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.