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
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,
This is a very interesting example, but the example is more complex, you need to look at a lot of apis, I will give the article at the end of the key class and attribute Interpretation.Also found a very interesting thing: the blog Park seems to have
---------
N years ago, dijela (Dijkstra), a software development guru, said, "goto statment is harmful !!", We recommend that you cancel the goto statement. Because the goto statement is not conducive to the maintainability of program code.
Here I
Http://entrian.com/goto/LookSource codeThe trace is modified for all functions, and then the set function is executed when an exception occurs.# Install the trace function, including all preceding frames.SYS. settrace (_ trace)Frame = SYS. _
Use of C + + goto statements1. Define a tag-like thing lable2. Use the Goto keyword to jump to lable, goto lable1#include 2#include string>3#include 4#include 5 6 7#include"header3.h"8 9 using namespacestd;Ten voidSwapint&,int&); One //void swap
1. Loop control Break statement:
Break ends the execution of the current for,while,do-while or switch structure.
Break can accept an optional numeric parameter to decide to jump out of a few loops.
'; break;case 10:echo ' quit at 10 '; Break 2 ;
Function: the reuse of code can be Implemented. function only needs to be defined 1 times, then the code in the function can be arbitrarily called. -the Basic concept of an unknown source Learning and time learning, such as the wrong pen,
Any algorithm is done using for/while/do while/goto/recursion .The logic ability of the algorithm is enhanced by using recursion to rewrite any loop.Converts an integer to a string, a binary lookup, and a data separation.Conversion of integer
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.