isxdigit, iswxdigit
Nach oben zu ctype.h - Index
Header-Datei
ctype.h, wctype.h
Kategorie
Klassifizierungsroutinen
Prototyp
int isxdigit(int c);
int iswxdigit(wint_t c);
Beschreibung
Prüft, ob ein hexadezimales Zeichen vorliegt.
isxdigit ist ein Makro, das nach dem ASCII-Code codierte ganzzahlige Werte durch Nachschlagen in einer Tabelle klassifiziert. Das Makro wird durch die Kategorie LC_CTYPE des aktuellen Gebietsschemas beeinflusst.
Dieses Makro kann durch die Anweisung #undef als Funktion zur Verfügung gestellt werden.
Rückgabewert
isxdigit gibt einen Wert ungleich 0 zurück, wenn c eine hexadezimale Ziffer (0 bis 9, A bis F, a bis f) oder ein anderes im Gebietsschema definiertes hexadezimales Zeichen ist.
Beispiel
#include <stdio.h> #include <ctype.h> int main(void) { char c = 'C'; if (isxdigit(c)) printf("%c is a hexadecimal digit\n",c); else printf("%c is not a hexadecimal digit\n",c); return 0; }
Portabilität
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
isxdigit |
+ |
+ |
+ |
+ |
|
iswxdigit |
+ |
+ |
+ |