Skip to main content
PProfileMatch
← Path

C++ · C++ If-Else, Switch and Loops

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Train station: platform entrances

Trick to keep in mind+3 XP

Case labels are doors you walk in through; only break lets you out.

A matching label is only the entry point into the block. From there execution keeps going down through the later cases until it meets a break or reaches the closing brace. Compilers can warn about this if you ask them to, but by default C++ stays quiet.

Read it once, then a question tests whether the trick stuck.