Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Switch statement, fall-through?

También llamado: switch statement · fall-through

Definition 2.8 University Computer Science — Year 1 · Capítulo 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.
Leer en el capítulo →