XiaoHui.net 笑汇程序员论坛首页
工作并快乐着,职业并休闲着
寻梦的岁月从不言辛苦几许,
不问收获几多……
» 游客:  申请新用户 | 登录 | 会员 | 统计 | 帮助 » XiaoHui.Net 笑汇程序员论坛 | 纯文字版 | 全站索引 | XiaoHui.com


[C#] 兄弟们看看这句翻译的,不太明白.谢谢

RSS 订阅当前论坛  

上一主题 下一主题
     

标题: [C#] 兄弟们看看这句翻译的,不太明白.谢谢  
  本主题被作者加入到他/她的 Blog 中  
 
vonsy
传说中的水手
Rank: 5Rank: 5


UID 281
精华 0
积分 42
帖子 42
阅读权限 1
注册 2005-8-8
状态 离线
兄弟们看看这句翻译的,不太明白.谢谢

Programming in the key of c#       p167       goto语句:
类似于一个变量,标号也有它自己的作用范围。“标号的作用范围是对它进行声明的那个语句块,内嵌在该语句块内的其他语句块也包括在内。(摘自<C# Language Specification>文档第8.4小节>).C#不允许你跳转到另一个语句块里去,也就是说,你不能从if 或while或try语句内跳转到它们的外部去;你可以跳出一个语句块,但不能跳入一个语句块.

8.4 Labeled statements
A labeled-statement permits a statement to be prefixed by a label. Labeled statements are permitted
blocks, but are not permitted as embedded statements.
labeled-statement:
identifier : statement
A labeled statement declares a label with the name given by the identifier. The scope of a label is the
block in which the label is declared, including any nested blocks. It is an error for two labels with the
same name to have overlapping scopes.
A label can be referenced from goto statements (section 8.9.3) within the scope of the label. This
means that goto statements can transfer control inside blocks and out of blocks, but never into blocks.
Labels have their own declaration space and do not interfere with other identifiers. The example
int F(int x) {
if (x >= 0) goto x;
x = -x;
x: return x;
}
is valid and uses the name x as both a parameter and a label.
Execution of a labeled statement corresponds exactly to execution of the statement following the label.
In addition to the reachability provided by normal flow of control, a labeled statement is reachable if the
label is referenced by a reachable goto statement.

总结:能出不能进.
翻译的是不是有点问题呢??
2006-4-21 15:33#1
查看资料  Blog  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题  


 


所有时间为 GMT+8, 现在时间是 2008-11-21 08:27 Powered by Discuz! 4.1.0 清除 Cookies - XiaoHui.Net 笑汇程序员论坛 - Archiver