当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
bin文件夹下的roslyn文件夹
Detailed explanation of numpy multidimensional array ndarray
华为发布“十大发明”,包含计算、智能驾驶等新领域
Derivative Operations on Vectors and Derivative Operations on Vector Cross and Dot Products
Go 使用mencached缓存
[GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
DHCP principle and configuration
golang : Zap日志整合
Universal js time date format conversion
Ali: How many methods are there for multi-threaded sequential operation?
理解和熟悉递归中的尝试
MySQL master-slave replication configuration construction, one step in place
阿里一面:多线程顺序运行有多少种方法?
2020 数学建模之旅
go : 使用 grom 删除数据库数据
When does MySQL use table locks and when does it use row locks?
Equation Derivation Proof of Vector Triple Product
window.open()的用法,js打开新窗体
go : go gin返回JSON数据
Redis 如何实现防止超卖和库存扣减操作?









