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

 #include   <ctype.h>

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

    isxdigit() tests whether 'c' is a hexadecimal digit; that is, 'A' -
    'F', 'a' - 'f', or '0' -'9'.

       Returns:     Nonzero if the test is true and zero if it is false.
                    The result is undefined if 'c' is not 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 (isxdigit(ch = getch()))
                   /* store & 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