O'Reilly logo

The C++ Programming Language, Special Edition by New Jersey Stroustrup Bjarne AT&T Labs Murray Hill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required