toascii
Nach oben zu Ctype.h - Index
Header-Datei
ctype.h
Kategorie
Konvertierungsroutinen
Prototyp
int toascii(int c);
Beschreibung
Übersetzt Zeichen in das ASCII-Format.
toascii ist ein Makro, das den Integerwert c in ein ASCII-Zeichen konvertiert, indem es alle Bits bis auf die unteren 7 Bits löscht. Dadurch ergibt sich ein Wert im Bereich zwischen 0 und 127.
Rückgabewert
toascii gibt den konvertierten Wert von c zurück.
Beispiel
#include <ctype.h> char* asciify(char* input) { while (*input) { *input = toascii(*input); input++; } return input; }
Portabilität
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |