Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Switch statement, fall-through?

Também chamado de: 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.
Ler no capítulo →