Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - isxdigit http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                                 isxdigit
   Determines  if c is one of the characters 0 to 9, A to F or a to f  by
   table  lookup.  Only values of c between -1 and 255  are  valid.  This
   macro is also implemented as a function in the library.

   Example
   #include <ctype.h>
   #include <stdio.h>
   #include <conio.h>
   #include <stdlib.h>

   main()
   {
   int i;
   char *ans[2] = { "not ", "" };

        for (i = -1; i < 255; i++)
        {
             printf("\n\nThe value %02x is :\n");
             printf("%salphanumeric\n",ans[isalnum(i)]);
             printf("%sa letter\n",ans[isalpha(i)]);
             printf("%sascii\n",ans[isasci(i)]);
             printf("%sa control\n",ans[iscntrl(i)]);
             printf("%sa digit\n",ans[isdigit(i)]);
             printf("%sprintable/not a space\n",ans[isgraph(i)]);
             printf("%slower case\n",ans[islower(i)]);
             printf("%sprintable\n",ans[isprint(i)]);
             printf("%sa punctuator\n",ans[ispunct(i)]);
             printf("%swhite space\n",ans[isspace(i)]);
             printf("%supper case\n",ans[isupper(i)]);
             printf("%sa hexadecimal digit\n",ans[isxdigit(i)]);
             printf("* Press a key for the next value *\n");
             getch();
        }
   }
   Return Value
   isalnum
   Returns non-zero if c is a letter or a digit.

   isalpha
   Returns non-zero if c is a letter.

   isascii
   Returns non-zero if c is between 0 and 127.

   iscntrl
   Returns non-zero if c is a control character (0 to 0x1F), or c == 0x7F.

   isdigit
   Returns non-zero for the digits 0 to 9.

   isgraph
   Returns non-zero if c is a printing character. (excluding the space).

   islower
   Returns non-zero if c is a lower-case character.

   isprint
   Returns non-zero if c is a printing character (including the space).

   ispunct
   Returns non-zero if c is a punctuation character.

   isspace
   Returns  non-zero  for  tabs, linefeeds, vertical  tabs,  form  feeds,
   carriage returns and spaces.

   isupper
   Returns non-zero if c is an upper-case character.

   isxdigit
   Returns non-zero if c is one of the characters 0 to 9, A to F or a to f.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson