Summary
In this chapter, we've taken a closer look at the operators provided by C++ and how we can use them to interact with our data. They were presented in groups—the first of which was arithmetic operators. These allow us to perform mathematical operations on our values (such as adding two numbers), or in the case of the activity we just completed, using modulus to determine whether one number is a multiple of another. We then moved on to looking at relational operators. These allow us to compare values with one another, such as determining whether two objects are equal, or whether one number is larger than another.
We then moved on to unary operators. These are operators that operate on a single operand, such as incrementing a value or negating a Boolean value. This led to looking at the assignment and logical operators. We explored how we can combine the simple assignment operator with arithmetic operators to more concisely multiply our values, and how we can evaluate...