O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

String Libraries

The string class is used to create and manipulate strings, removing the need to use char * and memory management to do it. The various functions that the class supplies replace and extend those that are available in the C string.h library.

The definition of the string class is found in the <string> library header file, and the header file contains many variations on the basic constructor. These range from empty constructions to ones with initialized strings of characters.

This chapter covers only the basic constructions here, by assigning a constant value, but it is important for you to remember that other possibilities exist. When you look at templates in Chapter 18, you will see some more advanced construction algorithms.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required