Comparing Blocks of Data

One action you are bound to need from time to time is that of comparing blocks of data. This may happen when you need to sort data, find some specific data element, or traverse a base of data. In the case of the example data file, which consists of textual article descriptions, this comparing of blocks of data basically translates into comparing strings. Note that strings are, in effect, nothing more than arrays of bytes, just like any other data block; the only difference is that strings are generally terminated by a null character. In this chapter, blocks of data will be treated as strings and text files as this makes the examples more readable.

Standard Pattern Matching

Comparing two patterns of data—or strings—in ...

Get C++ Footprint and Performance Optimization 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.