A goto statement causes your program to unconditionally
transfer control to the statement associated with the label specified on the goto statement.
A goto statement has the form:
Because the goto statement can interfere with the normal sequence
of processing, it makes a program more difficult to read and maintain. Often,
a break statement, a continue statement, or a function call
can eliminate the need for a goto statement.
If an active block is exited using a goto statement, any local
variables are destroyed when control is transferred from that block.
You cannot use a goto statement to jump over initializations.
A goto statement is allowed to jump within
the scope of a variable length array, but not past any declarations of objects
with variably modified types.
Example of goto Statements
The following example shows a goto statement that is used to jump
out of a nested loop. This function could be written without using a goto statement.
** This example shows a goto statement that is used to
** jump out of a loop.
n = 0;