Labels

[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]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值