-
-
Notifications
You must be signed in to change notification settings - Fork 9
Fallthrough
IsaacShelton edited this page Mar 21, 2022
·
1 revision
The fallthrough
keyword is used inside switch statements to fall though into the next block
switch animal_kind {
case AnimalKind::CAT
if animal_sub_kind != AnimalSubKind::TIGER {
fallthrough
}
print("The animal is a tiger")
case AnimalKind::DOG
print("The animal is a cat or dog")
}
See switch
for more information