In the last chapter, we learned about the various data types provided by C++, and how we can use them to store and represent the data within our systems. In this chapter, we will take a look at operators, the mechanisms by which we assign and manipulate this data. We've been using them throughout our work so far—it's hard to write C++ and not use them to some extent, at least—but we've yet to address them head-on. That's what we'll be doing now.
Operators come in many shapes and sizes, but in general, their role is to allow us to interact with our data. Be it assigning a value, modifying it, or copying it, this is all done through operators. We'll start by looking at arithmetic and relational operators. These allow us to perform mathematical operations such as adding, subtracting, and dividing numbers, and to compare values to one another.
We'll then move on to looking at assignment operators. These allow us to assign...