Typos that Compile

It is also possible to get unexpected behavior by making a typo that is not picked up by the compiler. This can happen when a typo causes a statement to look like a different, but equally valid, statement.

Difference Between Mathematical Statements and C/C++ Statements

Some mathematical expressions conform to the C/C++ syntax, but have a different meaning in C/C++ than they do in mathematics. This section shows pitfalls related to misconception of notation.

X Between Y and Z

Consider the mathematical expression 7 < x < 16, denoting that the value of x resides between 7 and 16. When this expression is used in C/C++, it does not behave as expected. Listing 15.7 demonstrates:

Code Listing 15.7. Incorrect Use of a Mathematical ...

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.