#include #include /* myisdigit: c ‚ª‚P‚Oi”Žš‚©HGASCII‚Ì‚Ý */ int myisdigit(int c) { return( c >= '0' && c <='9' ); } main() { int c, n; for( n = 0, c = 0; c <= 127; c++ ) if( isprint(c) ) { printf("%02x=%c ", c, c ); if( ++n%8 == 0 ) printf("\n"); } printf("\n"); for( n = 0, c = 0; c <= 127; c++ ) if( isdigit(c) && !myisdigit(c) || !isdigit(c) && myisdigit(c) ) { printf("isdigit(%02x)=%02x, myisdigit(%02x)=%02x\n", c, isdigit(c), c, myisdigit(c) ); n++; } if( n == 0 ) printf("myisdigit() is OK!\n"); else printf("myisdigit() is NG!\n"); } /* end of testmyisdigit.c */