O'Reilly logo

C++ for the Impatient by Brian Overland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Control Structures

A control structure determines what the program does next: make decisions, perform actions conditionally, and—critical to nearly all computing—loop. By looping, you direct the program to carry out repetitive actions efficiently, instead of being repetitive yourself.

This chapter begins with a concise guide to the grammar of C++ statements and then describes each control structure in detail. Finally it presents exception handling, a special kind of decision making that responds to exceptional situations at runtime. (Hence the name.)

4.1. Concise Summary of C++ Statements

The key to C++ statement syntax is that it’s recursive: Each of the items described in this section is a statement; therefore, each of them can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required