Break

From Wiring

Jump to: navigation, search
Name break
Description Ends the execution of a structure such as switch(), for(), or while() and jumps to the next statement after.
Syntax
break
Methods
Constructor
Parameters
Returns
Example
char letter = 'B';
 
switch(letter) {
  case 'A': 
    Serial.println("Alpha");  // Does not execute
    break;
  case 'B': 
    Serial.println("Bravo");  // Prints Bravo
    break;
  default:
    Serial.println("Zulu");   // Does not execute
    break;
}
Related switch, for, while
Language: English  • EspaƱol
Personal tools