Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>isxdigit() test for hexadecimal digit</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
isxdigit()               Test for Hexadecimal Digit

 #include   <ctype.h>

 int        isxdigit(c);
 int        c;                           Integer value to be tested

    isalnum() tests if 'c' is a hexadecimal digit ('A' - 'F', 'a' - 'f',
    or '0' -'9').

    Returns:    True (nonzero) if the integer satisfies the test
                condition or false (zero) if it does not.  The result is
                undefined if 'c' is other than an ASCII character or EOF.

      Notes:    isxdigit() is a macro.

  -------------------------------- Example ---------------------------------

    The following statements prompt for a hexadecimal digit and process
    only legal hex characters.

         #include <ctype.h>
         #include <stdio.h>

         int ch, x = 0;
         char *hdigit;

         main()
         {
             printf("Enter a hexadecimal number: ");
             while (ch = getch())
                  if (isxdigit(ch))
                      /* process hex number */
         }

See Also: isalnum() isalpha() isascii() iscntrl() isdigit()

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