1 |
Why is it that using some of the macros from ctype.h fails to compile? |
2 |
In particular, the three mentioned in the subject: line. |
3 |
|
4 |
Try this: |
5 |
|
6 |
#include <stdio.h> |
7 |
#include <ctype.h> |
8 |
|
9 |
int main(int argc, char *argv[]) |
10 |
{ |
11 |
int i; |
12 |
for (i = 0; i < 256; i++) { |
13 |
printf("%3d: ",i); |
14 |
if (isalpha(i)) printf(" alpha"); |
15 |
if (isalnum(i)) printf(" alnum"); |
16 |
if (isascii(i)) printf(" ascii"); |
17 |
if (isblank(i)) printf(" blank"); |
18 |
if (iscntrl(i)) printf(" cntrl"); |
19 |
if (isdigit(i)) printf(" digit"); |
20 |
if (isgraph(i)) printf(" graph"); |
21 |
if (islower(i)) printf(" lower"); |
22 |
if (isprint(i)) printf(" print"); |
23 |
if (ispunct(i)) punctf(" punct"); |
24 |
if (isspace(i)) printf(" space"); |
25 |
if (isupper(i)) printf(" upper"); |
26 |
if (isxdigit(i)) printf(" xdigit"); |
27 |
printf("\n"); |
28 |
} |
29 |
|
30 |
return 0; |
31 |
} |
32 |
|
33 |
|
34 |
-- |
35 |
Kevin O'Gorman, PhD |
36 |
-- |
37 |
gentoo-user@g.o mailing list |