中国开发网: 论坛: 程序员情感CBD: 贴子 385567
holly
那是 gcc 专有的扩展, 请参见 info gcc
File: gcc.info, Node: Case Ranges, Next: Mixed Declarations, Prev: Cast to Union, Up: C Extensions

Case Ranges
===========

You can specify a range of consecutive values in a single `case' label,
like this:

case LOW ... HIGH:

This has the same effect as the proper number of individual `case'
labels, one for each integer value from LOW to HIGH, inclusive.

This feature is especially useful for ranges of ASCII character codes:

case 'A' ... 'Z':

*Be careful:* Write spaces around the `...', for otherwise it may be
parsed wrong when you use it with integer values. For example, write
this:

case 1 ... 5:

rather than this:

case 1...5:

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录