4.3 Operators
One- and two-character operators are very often used in expressions. 3+4 is a simple example, but an expression such as !isBad && (x >= x0) &&(x <= x1) could also appear. You can achieve a lot in C++ with such sequences of operators and operands. Now that you know a lot about variables, types, and expressions, you should get to know the possible operators.
As an example, I will explain operators mainly using the int and bool types so that you get to know the repertoire first. However, many operators can also be applied to other types. These include built-in types, such as float, but also types from the standard library, such as std::string and std::stream.
In C++, you can define your own types that also support operators. It ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access