Page 35 - C-Language
P. 35

a = isdigit(c); /* Checks if c is a digit (0-9), returns zero here. */
         a = isgraph(c); /* Checks if c has a graphical representation (any printing character except
         space), returns non-zero here. */
         a = islower(c); /* Checks if c is a lower-case letter (a-z), returns zero here. */
         a = isprint(c); /* Checks if c is any printable character (including space), returns non-zero
         here. */
         a = isupper(c); /* Checks if c is a upper-case letter (a-z), returns zero here. */
         a = ispunct(c); /* Checks if c is a punctuation character, returns zero here. */
         a = isspace(c); /* Checks if c is a white-space character, returns zero here. */
         a = isupper(c); /* Checks if c is an upper-case letter (A-Z), returns non-zero here. */
         a = isxdigit(c); /* Checks if c is a hexadecimal digit (A-F, a-f, 0-9), returns non-zero here.
         */


        C99

         a = isblank(c); /* Checks if c is a blank character (space or tab), returns non-zero here. */


        There are two conversion functions. These are named using the prefix 'to'. These functions take
        the same argument as those above. However the return value is not a simple zero or non-zero but
        the passed argument changed in some manner.


        These conversion functions operate as shown, assuming the default C locale:


         int a;
         int c = 'A';

         /* Converts c to a lower-case letter (a-z).
          * If conversion is not possible the unchanged value is returned.
          * Returns 'a' here.
          */
         a = tolower(c);

         /* Converts c to an upper-case letter (A-Z).
          * If conversion is not possible the unchanged value is returned.
          * Returns 'A' here.
          */
         a = toupper(c);


        The below information is quoted from cplusplus.com mapping how the original 127-character
        ASCII set is considered by each of the classifying type functions (a • indicates that the function
        returns non-zero for that character)



          ASCII
                    characters                         iscntrl  isblank    isspace     isupper    islower    isalpha   isdigit   isxdigit   isalnum     ispunct    isgraph    isprint
          values

          0x00 ..
                    NUL, (other control codes)         •
          0x08


          0x09      tab ('\t')                         •        •          •

          0x0A ..  (white-space control codes:
                                                       •                   •
          0x0D      '\f','\v','\n','\r')


          0x0E ..  (other control codes)               •


        https://riptutorial.com/                                                                               11
   30   31   32   33   34   35   36   37   38   39   40