Stats

74 Contributors: 8 Monday, December 19, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Jump Statements

Syntax

  • return val; /* Returns from the current function. val can be a value of any type that is 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; /* Unconditionally jumps to the beginning of an Iteration Statement (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, long jump, that is specified with a data type, jmp_buf, and C library calls, setjmp and longjmp.

See also

Iteration Statements/Loops: for, while, do-while

Related Examples