Chapter 6. Expressions and Statements

 

Premature optimization is the root of all evil.

 
 --D. Knuth
 

On the other hand, we cannot ignore efficiency.

 
 --Jon Bentley

Desk calculator exampleinputcommand line argumentsexpression summarylogical and relational operatorsincrement and decrementfree storeexplicit type conversionstatement summarydeclarationsselection statementsdeclarations in conditionsiteration statementsthe infamous gotocomments and indentationadviceexercises.

A Desk Calculator

Statements and expressions are introduced by presenting a desk calculator program that provides the four standard arithmetic operations as infix operators on floating-point numbers. The user can also define variables. ...

Get The C++ Programming Language, Special Edition 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.