10. Expressions

Programming is like sex: It may give some concrete results, but that is not why we do it.

– apologies to Richard Feynman

Introduction

A Desk Calculator

The Parser; Input; Low-Level Input; Error Handling; The Driver; Headers; Command-Line Arguments; A Note on Style

Operator Summary

Results; Order of Evaluation; Operator Precedence; Temporary Objects

Constant Expressions

Symbolic Constants; consts in Constant Expressions; Literal Types; Reference Arguments; Address Constant Expressions

Implicit Type Conversion

Promotions; Conversions; Usual Arithmetic Conversions

Advice

10.1. Introduction

This chapter discusses expressions in some detail. In C++, an assignment is an expression, a function call is an expression, the ...

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