14 What’s “new”: The StringParser Class

One of the themes of this book is that there’s nothing magic about classes and object-oriented programming. Contrary to what some books may tell you, a class is not useful just because it’s a class—any more than a tool consisting of random pieces of metal stuck together is useful. A class becomes useful when it provides a set of related services that solve common programming problems.

One of the most common tasks in programming is to get input and analyze it. This chapter features a class—the StringParser class—that breaks an input string into a series of substrings, each containing a word.

Image Most of the ...

Get C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart 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.