Reposted from Sina Blog:
1: Why not use the GOTO statement?
Source (from Wikipedia ):
Goto is a statement that can be found in many computer programming languages. It is an English word.GoAndTo. When executing this statement, it transfers the
Goto statements are notorious in C/C ++, and even some books or company programming specifications. The result is that when some programmers see the goto statement being used in a program, they instinctively think that the program is "junk ". In
Whether goto statements should be used
A goto statement is also known as an unconditional transfer statement , which is usually used in conjunction with a conditional statement to change the flow of the program, allowing the program to go
For goto statements, it is no longer recommended in C/C ++, and there is no goto in Java. Why does the GOTO statement be re-used in C?
First, let's take a look at the usage of the GOTO statement in C:1) The basic function is to execute the
This article reproduced: http://blog.chinaunix.net/uid-26715658-id-3254915.htmlBreak and Continue use the same range, both can be used for loops, and the break in It can also be used for switch. function also has certain similarity, break is
Objective
A goto statement is also called an unconditional transfer statement, and its basic form is as follows:
Statement marking by a valid identifier and symbol ";" , where the identifier's naming convention is the same as the variable name,
The goto operator is a new feature added after php5.3+ to jump to another location in the program; the usage is simple: goto followed by a flag with the target location, with a colon marked at the destination, as follows:
Copy Code code as
++ ++
A series of in-depth understanding of C language: goto
Follow the original author to view other blog posts.
This article is original on this site. You are welcome to repost it! Reprinted please indicate the
In this program because of the use of the string cut in the last article, and the use of the Goto force Jump statementHowever, when used in the program, but found an error, when the character cut the code snippet if directly as a non-nested
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.