1. Introduction of prototypes
#include <ctype.h>
2. Character Judgment function
Name of function |
Judgment set to (true) |
Isalnum () |
Letters or numbers |
Isalpha () |
Letters |
Isblank () |
White space characters (spaces, tabs, line breaks) or any localized characters that are specified as whitespace |
Iscntrl () |
Control character |
Isgraph () |
All printable characters except for whitespace |
Islower () |
lowercase letters |
Isprint () |
printable characters |
Ispunct () |
Punctuation (except spaces and alphanumeric printable characters) |
Isspace () |
Whitespace characters: spaces | wrapping | paper | return | vertical TAB | Horizontal tab | or localized definition character |
Isupper () |
Capital |
Isxdigit () |
hexadecimal numeric characters |
|
|
ToLower () |
Returns the lowercase character if it is an uppercase character, otherwise, returns the original argument |
ToUpper |
If it is lowercase, returns the uppercase character or returns the original argument |
eg
#include <stdio.h><ctype.h>int main (void) { int CH; Puts (" Please enter a number ") ; = GetChar (); if (IsDigit (CH)) // putchar (CH); Else printf (" not \ n");}
C's ctype.h prototype