Chapter 30. Using Strings

  • Learn about the standard C++ string data type

  • Investigate the basic_string class template

  • Examine the standard string operators

  • Explore the standard string member functions

  • Learn to use standard strings with C -style string functions


Characters and Standard Strings

Strings of characters are the basis of written communication, and they are the basis of programming, too—we need them to write source code in an editor, to construct electronic documents, to generate reports, and so on. You’ve seen strings used in this book since Chapter 1: The ANSI C solution to strings is a null-terminated array of characters; although the Standard C++ Library provides full support for these primitive strings, they’re a bit ...

Get Practical C++ 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.