Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Switch statement, fall-through » ?

Aussi appelé : switch statement · fall-through

Definition 2.8 University Computer Science — Year 1 · Chapitre 2 — C: Types, Operators and Control Flow

A switch statement, written with switch, evaluates an integer expression and jumps to the case label with that value, or to default. Execution then continues downwards through the following labels until a break: passing from one case into the next is called fall-through.

The switch of days_in as jumps. The value of month selects an entry point; without a break the thirty-day case runs on into default, which overwrites 30 with 31.
The switch of days_in as jumps. The value of month selects an entry point; without a break the thirty-day case runs on into default, which overwrites 30 with 31.
Lire dans le chapitre →