Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <ctype.h>
    int isascii( int c );
    int __isascii( int c );
    #include <wchar.h>
    int iswascii( wint_t c );

Description:
    The isascii function tests for a character in the range from 0 to 127.

    The __ isascii function is identical to isascii.  Use __ isascii for
    ANSI/ISO naming conventions.

    The iswascii function is similar to isascii except that it accepts a
    wide-character argument.

Returns:
    The isascii function returns a non-zero value when the character is in
    the range 0 to 127; otherwise, zero is returned.  The iswascii function
    returns a non-zero value when c is a wide-character representation of an
    ASCII character.

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

    char chars[] = {
        'A',
        0x80,
        'Z'
    };

    #define SIZE sizeof( chars ) / sizeof( char )

    void main()
      {
        int   i;

        for( i = 0; i < SIZE; i++ ) {
          printf( "Char %c is %san ASCII character\n",
                chars[i],
                ( isascii( chars[i] ) ) ? "" : "not " );
        }
      }

    produces the following:

    Char A is an ASCII character
    Char   is not an ASCII character
    Char Z is an ASCII character

Classification:
    WATCOM

__ isascii conforms to ANSI/ISO naming conventions

Systems:
     isascii - All, Netware

    __isascii - All, Netware
    iswascii - All, Netware

See Also:
    isalnum, isalpha, iscntrl, isdigit, isgraph, isleadbyte, islower,
    isprint, ispunct, isspace, isupper, iswctype, isxdigit, tolower, toupper

See Also: isleadbyte iswctype

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