Break

From HyPhy Wiki
Jump to: navigation, search

break is a control flow tool.

Syntax

 break;

Functionality

break is a control flow tool that may only exist during a while or for loop. It terminates nearest enclosing loop.

Example

  1.   for (k = 0;k <= 10; k=k+1)
  2.   {
  3.        if (k >= 2)
  4.        {
  5.            break;
  6.        }   
  7.    }   
  8.  
  9.    fprintf(stdout,k);

In the code example, k will print 2.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox