3. Operators and Control Structures

In the preceding chapter you learned about the basic data types in C++, as well as the fundamentals of working with variables. For the most part, the examples there just assigned values to different variables and then printed those variables within some context. In order to do more with your programs, you need to use operators and control structures.

You’ve already seen a couple of operators, including the assignment (=), concatenation for strings (+), and arithmetic operators. In this chapter you’ll do some more arithmetic, learn about the comparison and logical operators, and master the increment and decrement operators.

The other main focus in this chapter is control structures: language constructs that ...

Get C++ Programming: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.