Z
Zhang Yuan
When I read c standard ISO/IEC 9899:201x
I'm confused about the sentence below ,why we make the switch statement
within the scope of that variably modified type identifier.
Thanks in advance if any one can offer some code example or explanation.
------
If a switch statement has an associated case or default label within the scope of an identifier with a variably modified type, the entire switch statement shall be within the scope of that identifier.154)
154) That is, the declaration either precedes the switch statement, or it follows the last case or default label associated with the switch that is in the block containing the declaration.
------
I'm confused about the sentence below ,why we make the switch statement
within the scope of that variably modified type identifier.
Thanks in advance if any one can offer some code example or explanation.
------
If a switch statement has an associated case or default label within the scope of an identifier with a variably modified type, the entire switch statement shall be within the scope of that identifier.154)
154) That is, the declaration either precedes the switch statement, or it follows the last case or default label associated with the switch that is in the block containing the declaration.
------