Guardian C Library Calls Reference Manual
toascii (supplementary)
3-224 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
toascii (supplementary)
The toascii function determines the ASCII equivalent of a nonASCII character.
character
is the character whose ASCII value you desire.
Return Value
is the ASCII equivalent of character.
Usage Guidelines
•
If character is already an ASCII value, toascii simply returns it unchanged;
otherwise, toascii converts character to an unsigned char, sets the high-order bit to
zero, and returns that value.
Usage Guidelines
•
The character-testing routine toascii is implemented as a macro, but the C compiler
provides an underlying function with the same name as the macro. Although the
macro is faster than the function, it evaluates its argument more than once.
Consequently, if you need to provide an expression with side effects as the argument
to this routine, you should undefine the macro so that the C compiler uses the
function instead. For more information about undefining macros, refer to the C/C++
Programmer’s Guide.
•
The ISO/ANSI C standard does not specify toascii. However, the POSIX.1 standard
and XPG4 specification specify toascii.
#include <ctypeh>
int toascii(int character);