Skip to content

Control Flow

At its core, a program is about "doing different things based on conditions" and "repeating certain actions." In this chapter, we walk through all the syntax in C++ that controls program execution flow—from the most basic if/else to various loops, and finally to the range-for introduced in C++11. You will find that range-for is much more pleasant to write than the traditional for(int i=0; ...), and we will use it extensively later on.

Chapter Contents

v0.7.0-9-g940ec1b · 940ec1b · 2026-07-05