Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the C# switch statment need a break; [closed]

Is C# true to C++, needing a break; per case:? ..Default is fall-thru - Unlike VB

OR will it automatically break out of a case once found? ..Default is break - Like VB


Edit: So it is a combination of both, Default is none - You have to specify either break; or goto;

like image 267
Robin Rodricks Avatar asked Mar 02 '23 02:03

Robin Rodricks


1 Answers

Every case needs to have either a break; or goto case statement in C#

like image 100
Agent_9191 Avatar answered Mar 12 '23 07:03

Agent_9191