Namensräume
Varianten
Aktionen

switch statement

Aus cppreference.com
< c‎ | language

 
 
C-Sprache
Allgemeine Themen
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Preprocessor
Kommentare
Keywords
ASCII-Tabelle
Escape-Sequenzen
Geschichte der C
Flusskontrolle
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bedingte Ausführung Aussagen
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
switch statement
Iterationsanweisungen
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gehe Aussagen
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funktion Erklärung
inline-Spezifizierer
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Specifiers
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv Planer
Storage-Class-Planer
alignas Spezifizierer (C99)
Literale
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressions
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Reihenfolge der Auswertung
alternative Betreiber
Betreiber
Operatorvorrang
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
Attribute (C99)
wirft
Verschiedenes
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Inline Montage
 
Führt Code nach Wert eines ganzzahligen Argument
Original:
Executes code according to value of an integral argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dort eingesetzt, wo eine oder mehrere aus vielen Zweigen der Code nach einem ganzzahligen Wert ausgeführt werden müssen .
Original:
Used where one or several out of many branches of code need to be executed according to an integral value.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Syntax

switch ( expression ) {
case constant_expression1 :
statement1 (optional)
case constant_expression2 :
statement2 (optional)
... ... ...
case constant_expressionn :
statementn (optional)
default: default_statement (optional)

}

[Bearbeiten] Erklärung

expression sind ein Ausdruck, umwandelbar in einen Integer-Wert sein .
Original:
expression shall be an expression, convertible to an integer value.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Alle constant_expressions sind konstante Ausdrücke, umwandelbar in einen Integer-Wert, die einzigartig in diesem switch Aussage sein
Original:
All constant_expressions shall be constant expressions, convertible to an integer value, which is unique within this switch statement
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Wenn die expression ergibt einen Wert, der gleich dem Wert eines der definierten constant_expressioni die statementi (falls vorhanden) und allen nachfolgenden Aussagen (außer default_statement, falls vorhanden) werden ausgeführt. Wenn der Wert des expression mit keinem der constant_expressions wird die default_statement ausgeführt falls vorhanden .
Original:
If the expression evaluates to a value, equal to the value of one of the defined constant_expressioni, the statementi (if present) and all subsequent statements (except default_statement, if present) are executed. If the value of the expression does not match any of the constant_expressions, the default_statement is executed if present.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
verwendet werden können. In diesem Fall wird die Ausführung des switch Anweisung beendet .
Original:
It is useful to note, that if the execution of subsequent statements is undesirable, the
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Keywords

switch, case, default

[Bearbeiten] Beispiel