© Giulio Zambon 2016

Giulio Zambon, Practical C, 10.1007/978-1-4842-1769-6_8

8. Searching

Giulio Zambon

(1)Harrison, Aust Capital Terr, Australia

Searches work by comparing primitive or structured data types. Therefore, it makes sense to begin this chapter with a section about comparisons.

Comparisons

In general, when discussing comparisons, you need to distinguish between numbers (including pointers), null-terminated character strings and unstructured blocks of memory, and everything else.

To compare numbers, C provides the relational operators ==, !=, >, <, >=, and <=, although, as you learned in Chapter 2, dealing with floating point numbers is tricky.

For unstructured blocks of memory and null-terminated character strings, C provides several functions, ...

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.