togo
来源:互联网 发布:php 二进制 编辑:程序博客网 时间:2024/06/07 07:34
某位大神不推荐使用togo,认为togo使代码变得混淆、不易理解。在此简单介绍下togo的用法。
int a = 1; start:{ a++; NSLog(@"%d",a); } if (a<5) { goto start; }else{ goto end; } end:{ NSLog(@"GG"); }
这种用法是正确的。
为什么toog语法一定要写在中间,这和代码的执行顺序有关。我们来看下togo放在不同位置时输入的结果。
int a = 1; if (a<5) { goto start; }else{ goto end; } start:{ a++; NSLog(@"%d",a); } end:{ NSLog(@"GG"); }
int a = 1; start:{ a++; NSLog(@"%d",a); } end:{ NSLog(@"GG"); } if (a<5) { goto start; }else{ goto end; }
0 0
- togo
- 购买多人版InterBase Server可免费获得InterBase ToGo
- If you have a chance togo abroad ,which country you choose ?
- Delphi for iOS开发指南(14):在iOS应用程序中使用InterBase ToGo
- Delphi for iOS开发指南(14):在iOS应用程序中使用InterBase ToGo
- 使用libcaffe为工程添加深度学习功能
- Android软键盘遮挡输入框解决方法
- 手动调整Ubuntu16系统的分辨率
- Apache POI 导入导出EXCLE
- 用例设计过程
- togo
- 【spring】——依赖注入
- Linux学习笔记--多命令执行
- Scala学习笔记 --- scala中class与object
- eclipse安装jadeclipse
- 快速实现python c扩展模块
- PAT A1028. List Sorting (25)
- 企业是如何避免重发开发的,
- Android检测网络类型