Contact: aviboots(AT)netvision.net.il
40,904 questions
53,356 answers
573 users
#include <stdio.h> #include <ctype.h> int main(void) { if (isdigit('1')) printf("digit\n"); if (isdigit('a')) printf("digit\n"); else printf("NOT digit\n"); return 0; } /* run: digit NOT digit */
#include <stdio.h> #include <ctype.h> int main(void) { int x = 'b', y = '3'; if (isdigit(x)) printf("digit\n"); else printf("NOT digit\n"); if (isdigit(y)) printf("digit\n"); else printf("NOT digit\n"); return 0; } /* run: NOT digit digit */