Description

4 LOGICAL AND RELATIONAL OPERATORS

Now that you know how to compile binary operators, you’re going to add a whole mess of them (plus one more unary operator). In this chapter, you’ll add three logical operators: NOT (!), AND (&&), and OR (||). You’ll also add the relational operators: <, >, ==, and so on. Each of these operators tests some condition, resulting in a value of 1 if that condition is true and 0 if it’s false.

The && and || operators differ from the binary operators we’ve seen so far because they short-circuit

Get Writing a C Compiler 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.