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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.