|
|
|
|
|
by bbrizzi
5350 days ago
|
|
If you want to be picky, I'ld go with: if ((x >= 'a' && x <= 'z') ||
(x >= 'A' && x <= 'Z') ||
(x >= '0' && x <= '9'))
As in a regular text file you're more likely to hit an alphanumerical character than a number. If the first OR statement is true, any good compiler will skip the next two clauses. |
|
This has nothing to do with the compiler, it's part of the language specification. If your compiler doesn't comply with this, it's broken.