If c# switch-case statements can't fall through anyhow, why require a break keyword after each case?
-
-
Shouldn't that be #c# ?
-
If it actually worked, I would've. =P
Keskustelun loppu
Uusi keskustelu -
-
-
You can use return, or goto case, or an inifite loop and not have the break. https://msdn.microsoft.com/en-us/library/06tc147t.aspx …
-
but why isn't the break just assumed at the end of each case, if nothing else is present?
- Näytä vastaukset
Uusi keskustelu -
-
-
It's to prevent people with a c programming background from expecting fall through to work.
-
A compile time error is better then unexpected results. C# is very much about making things very clear.
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.