Jump Statements
suggest changeSyntax
- return val; /* Returns from the current function. val can be a value of any type that converts to the function’s return type. */
- return; /* Returns from the current void function. */
- break; /* Unconditionally jumps beyond the end (“breaks out”) of an iteration statement (loop) or out of the innermost switch statement. */
- continue; /* Jumps to the loop continuation: the third expression of a for loop, or the controlling expression of a while or do loop. */
- goto LBL; /* Jumps to label LBL. */
- LBL: statement /* any statement in the same function. */
Remarks
These are the jumps that are integrated into C by means of keywords.
C also has another jump construct, specified with the type jmp_buf and the library functions setjmp and longjmp. A longjmp that was not matched with a successful setjmp in the same invocation of the function, or that jumps into a function that has already returned, has undefined behavior.
See also
See also iteration statements.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents