monic part 6: the mC programming language and compiler
|
06-25-2022, 06:33 PM
Post: #14
|
|||
|
|||
RE: monic part 6: the mC programming language and compiler
In addition to the case/default structuring, because switch is a block, one can declare locals like so:
switch (<expr>) { double x; // local and visible to all cases, this is legal in C case <A>: <code> ... } While this is valid C, there is no widespread use as far as I can tell and few know about this. Initializers of locals in this switch block are also just ignored. Also, declaring variables with initializers in case blocks require braces. On the other hand, the PC-G850 doesn't permit variable declarations anywhere except at the start of a function. Simplified C is still very workable! - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)