Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at toascii, __toascii.
Converts characters to 7-bit ASCII by truncation.
Syntax
int __toascii(
int c
);
#define toascii __toascii
Parameters
c
Character to convert.
Return Value
__toascii converts the value of c to the 7-bit ASCII range and returns the result. There is no return value reserved to indicate an error.
Remarks
The __toascii routine converts the given character to an ASCII character by truncating it to the low-order 7 bits. No other transformation is applied.
The __toascii routine is defined as a macro unless the preprocessor macro _CTYPE_DISABLE_MACROS is defined. For backward compatibility, toascii is defined as a macro only when __STDC__ is not defined or is defined as 0; otherwise it is undefined.
Requirements
| Routine | Required header |
|---|---|
toascii, __toascii |
C: <ctype.h> C++: <cctype> or <ctype.h> |
The toascii macro is a POSIX extension, and __toascii is a Microsoft-specific implementation of the POSIX extension. For additional compatibility information, see Compatibility in the Introduction.