O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

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

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

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