当前位置:网站首页>Goto statements
Goto statements
2022-07-30 08:03:00 【Code Writers】
The goto statement in C language can only be used in the same function segment
The usage is as follows:
goto: label; // to the label position
label:
The role of the goto statement in the figure below is equivalent to the break statement.
Java continues to use the tag mechanism, but it is different from C's goto statement usage:
Java's goto statement can only be used in loops
Use with break
Labeled break will break and break out of the loop pointed to by the label.Use with continue
A tagged continue will reach the position of the tag and re-enter the loop immediately following the tag.
The abuse of the goto statement can easily lead to confusion in the logical structure of the code and increase the difficulty of reading the code. Therefore, the goto statement is generally used less in the C language and less in the Java language.
边栏推荐
猜你喜欢

识别“数据陷阱”,发现数据的可疑之处

阿里二面:Sentinel vs Hystrix 对比,如何选择?

Universal js time date format conversion

Redis下载与安装

Huawei released "ten inventions", including computing, intelligent driving and other new fields

CTO说不建议我使用SELECT * ,这是为什么?

Detailed explanation of numpy multidimensional array ndarray

Graphical relational database design ideas, this is too vivid

Go语学习笔记 - gorm使用 - 数据库配置、表新增 Web框架Gin(七)

How does Redis prevent oversold and inventory deduction operations?
随机推荐
idea built-in translation plugin
“AI教练”请进家,家庭智能健身蓬勃发展
如何理解普吕克坐标(几何理解)
新人误删数据,组长巧用MySQL主从复制延迟挽回损失
学生成绩管理系统(C语言)
go : 使用gorm创建数据库记录
golang : Zap日志整合
The Geometric Meaning of Vector Cross Product and the Calculation of Modulus
AI can identify race from X-rays, but no one knows why
PXE efficient mass network capacity
uniapp中canvas与v-if更“配”
schur completement
No, the Log4j vulnerability hasn't been fully fixed yet?
Detailed explanation of numpy multidimensional array ndarray
矩阵的行列式的计算及其源码
Vue2进阶篇-编程式路由导航、缓存路由组件、路由的激活与失活
空间直线到平面上的交点的计算证明及其源码
VR机器人教你如何正确打乒乓球
Redis 如何实现防止超卖和库存扣减操作?
华为发布“十大发明”,包含计算、智能驾驶等新领域