The break keyword is used to prematurely exit a for, while, or do loop or to mark the end of a case block in a
switch statement.
Examples
for (i=0; i<max; i++)
{
if (<loop finished early>)
{
break;
}
}
int type = <some value>;
switch (type)
{
case 1:
<statement>
break;
case 2:
<statement>
break;
default:
<statement>
}
Comments
Post a Comment