Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ishex(3C) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctype(3C)



ishex(3C)                         SDK R4.11                        ishex(3C)


NAME
       ishex - determine whether a character is hexadecimal

SYNOPSIS
       #include <ctype.h>

       int c, result;
       ...
       result = ishex(c);

DESCRIPTION
       Use the ishex macro to determine whether a character is a
       hexadecimal.  Hexadecimals are 0 - 9 and a - f or A - F.

       The ishex macro is the same as the isxdigit macro.

       Do not try to redeclare this macro or you might get unexpected
       results.

EXAMPLE
       /* Program testit for the ishex() macro */

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

       int  i = 1, result;

       main(argc, argv)
       int     argc;
       char    *argv[];
       {
           while (i < argc) {
               printf("Is %c a hexadecimal digit?  ", argv[i][0]);
               printf("%s.\n",
               (result = ishex(argv[i][0])) == 0 ? "No" : "Yes");
               i++;
           }
       }

       Calling testit with A, f, g, and H generates the output

       Is A a hexadecimal digit?  Yes.
       Is f a hexadecimal digit?  Yes.
       Is g a hexadecimal digit?  No.
       Is H a hexadecimal digit?  No.

RETURNS
       The ishex macro returns a nonzero value if the character is
       hexadecimal.  Otherwise, it returns 0.

SEE ALSO
       iohexstrtoint(3K), ctype(3C).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026