Team LiB
Previous Section Next Section

Chapter 4. Expressions

 

Contents

 

Section 4.1 Fundamentals

 

Section 4.2 Arithmetic Operators

 

Section 4.3 Logical and Relational Operators

 

Section 4.4 Assignment Operators

 

Section 4.5 Increment and Decrement Operators

 

Section 4.6 The Member Access Operators

 

Section 4.7 The Conditional Operator

 

Section 4.8 The Bitwise Operators

 

Section 4.9 The sizeof Operator

 

Section 4.10 Comma Operator

 

Section 4.11 Type Conversions

 

Section 4.12 Operator Precedence Table

 

Chapter Summary

 

Defined Terms

 

C++ provides a rich set of operators and defines what these operators do when applied to operands of built-in type. It also allows us to define the meaning of most of the operators when applied to operands of class types. This chapter focuses on the operators as defined in the language and applied to operands of built-in type. We will also look at some of the operators defined by the library. Chapter 14 will show how we can define operators for our own types.

 

An expression is composed of one or more operands and yields a result when it is evaluated. The simplest form of an expression is a single literal or variable. The result of such an expression is the value of the variable or literal. More complicated expressions are formed from an operator and one or more operands.

 
Team LiB
Previous Section Next Section