switch statement
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
一体型の引数の値に応じてコードを実行します
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.
You can help to correct and verify the translation. Click here for instructions.
どこで使用されるコードの多くの枝の1つまたはいくつかのうち、積分値に応じて実行する必要が.
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.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 構文
switch ( expression ) {
|
|||||||||
[編集] 説明
expressionは、整数値に変換式でなければならない.
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.
You can help to correct and verify the translation. Click here for instructions.
すべてconstant_expressionsは、この
switch文内で一意となる整数値に変換定数式でなければならないOriginal:
All constant_expressions shall be constant expressions, convertible to an integer value, which is unique within this
switch statementThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
expressionが定義constant_expressioniのいずれかの値に等しい値に評価される場合は、statementi(存在する場合)およびそれ以降のすべてのステートメント(default_statement除いて、存在する場合)が実行されます。 expressionの値がconstant_expressionsのいずれとも一致しない場合は、存在する場合、default_statementが実行されます.
が使用可能であることを、覚えておくと便利です。その場合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.
You can help to correct and verify the translation. Click here for instructions.
switch文の実行は終了します. Original:
It is useful to note, that if the execution of subsequent statements is undesirable, the
ステートメントを破る</div> can be used. In that case the execution of the
Original:
break statement
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
switch statement terminates. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] キーワード
[編集] 例
| This section is incomplete Reason: no example |