Arithmetic Operators
Arithmetic operators are those that allow us to perform mathematical operations on our data. These are very self-explanatory and straightforward to use as, aside from the modulus operator, they have the same symbol that we'd use for everyday mathematics. For example, in order to add a number, you simply use the "+" sign as you would anywhere. Generally, these operators are going to be used with numeric data types, however, there's nothing stopping a type from implementing this operator. This will be covered as the final topic of the chapter.
Let's take a quick look at our four basic operators: addition, subtraction, multiplication, and division. As stated previously, these four operators have the same symbols that you'd use day to day, so they should be familiar. The following example implements all four types of arithmetic operators:
// Arithmetic operators. #include <iostream> #include <string> int main() { &...