goto: | Function call: | |
Scope | function is defined in the label, so the function | |
Jump operation | Unconditional | When call to preserve the scene, copies the actual parameters, and then the jump |
Survival | Because not left value, it is not survival, is only meaningful at compile time. | |
Current lines of code programmers line break | Program code for line breaks |
Examples:
#include <, iostream.h> void main () { int I = . 1 , S = 0 ; Re: S = S + I; IF (I < 100 ) { I = I + . 1 ; GOTO Re; } COUT << S << endl; }
. equivalent to use if and goto produced a cycle, does not recommend the use of goto keyword, because he makes the structure of the program becomes a mess all over the goto statement of the program will make it difficult to grasp the gravity not easy to understand and maintain the program.