[size=medium]Label names are
distinct from variable and function names, so you do not need to worry about name collisions if you give a
label the same name as a variable or function.
When break is used with a label, it jumps to the end of, or terminates, the named statement, which may
be any enclosing statement. The named statement need not be a loop or switch ; a break statement used
with a label need not even be contained within a loop or switch . The only restriction on the label of the
break statement is that it name an enclosing statement. The label can name an if statement, for
example, or even a block of statements grouped within curly braces, for the sole purpose of naming the
block with a label.
You need the labeled form of the break statement only when you are using nested loops or switch
statements and need to break out of a statement that is not the innermost one.
[/size]
distinct from variable and function names, so you do not need to worry about name collisions if you give a
label the same name as a variable or function.
When break is used with a label, it jumps to the end of, or terminates, the named statement, which may
be any enclosing statement. The named statement need not be a loop or switch ; a break statement used
with a label need not even be contained within a loop or switch . The only restriction on the label of the
break statement is that it name an enclosing statement. The label can name an if statement, for
example, or even a block of statements grouped within curly braces, for the sole purpose of naming the
block with a label.
You need the labeled form of the break statement only when you are using nested loops or switch
statements and need to break out of a statement that is not the innermost one.
[/size]