Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>isalnum() test for alphanumeric character (macro)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 isalnum()               Test for Alphanumeric Character (Macro)

 #include   <ctype.h>

 int        isalnum(c);
 int        c;                           Integer to be tested

    isalnum() is a macro that tests if 'c' is an alphanumeric character;
    that is, if it is included in one of the sets:

                        A-Z,  a-z, or  0-9

    Returns:    True (nonzero) if the integer is in one of the sets, and
                0 if not.  The result is undefined if 'c' is other than
                an ASCII character (c > 127) or EOF.

      Notes:    isalnum() is a macro.

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

    The following statements continue to get input from stdin until a
    non-alphanumeric character is read.

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

           int x = 0;
           char buffr[80];
           char ch;

           main()
           {

              while (isalnum(ch = getche()) || ch == 32)
                   buffr[x++] = ch;
              printf("\ndata input from console: %s \n",buffr);
           }





See Also: isalpha()

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