Chapter 4. Control Statements, Part 2

Images

Objectives

In this chapter, you’ll:

Use the for and dowhile iteration statements.

Perform multiple selection using the switch selection statement.

Use C++17’s [[fallthrough]] attribute in switch statements.

Use C++17’s selection statements with initializers.

Use the break and continue statements to alter the flow of control.

Use the logical operators to form compound conditions in control statements.

Understand the representational errors associated with using floating-point data to hold monetary values.

Use C++20’s [[likely]] and [[unlikely]] attributes to help the compiler optimize selection ...

Get C++20 for Programmers, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.