Simulater/Generated switch statement range in c

后端 未结 3 682
暖寄归人
暖寄归人 2021-01-28 17:52

Is there a hack to support range case in a c(99?) or objective C switch statement ? I know this is not supported to write something like this:

switch(x)
   case          


        
3条回答
  •  囚心锁ツ
    2021-01-28 18:15

    GCC has an extension to the C language that allows something similar to your first example, but other than that, if there was a portable/ANSI way of doing it, it would have been done by now. I don't believe there is one.

提交回复
热议问题