Web page hosting, cheap domain name & website promotion services
  

 Index

Next: , Previous: Cast to Union, Up: C Extensions



5.21 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:
 

 

  

 

Domain registration & domain transfer | Register cheap domain name 

Disclaimers: This document is provided as free service for the benefits of Active-Venture.com's virtual hosting customers only.

 

 

" The most horrifying thing about Unix is that, no matter how many times you hit yourself over the head with it, you never quite manage to lose consciousness. It just goes on and on.   "