Home > Back-end >  The switch (expression)
The switch (expression)

Time:11-07

CodePudding user response:

A break statement less,

CodePudding user response:

This is my book procedures do not break and then to see the results

CodePudding user response:

Is the main switch (expression) in the expression of two conditions is how to run the

CodePudding user response:

Have been run down without a break,

CodePudding user response:

The
reference 4 floor ooolinux reply:
has been run down without a break,

Case1 is not implemented

CodePudding user response:

The
reference 4 floor ooolinux reply:
has been run down without a break,

When expression has two how to operate

CodePudding user response:

From the start of the match, encounter break is over,

CodePudding user response:

First please allow me to correct your output: there is a line break other
Then let us analyze your code (to be honest it is better to copy the code, behind the images, so that at least reply you more -- -- -- -- -- & gt; Helpful hints)
Int a=0;
Int b=2;
Its core is the switch (a, b + + * a)
It + + a, b *, this is a comma, comma associative operations from left to right, to the last value as the value of the expression (you can also check)
So is a plus 1 first, become 1, then 2 * 1=2 + + as a, b * a the value of the expression, which is equal to the switch (2), because there is no break, so would have been implemented,
So from the printf (" 2 "); At the back of the statement to be executed, is 23 and then wrap the other

CodePudding user response:

Hope to be able to help you, if you have questions or other, welcome to discuss
  • Related