# C 標準庫 - <ctype.h>
## 簡介
C 標準庫的 **ctype.h** 頭文件提供了一些函數,可用于測試和映射字符。
這些函數接受 **int** 作為參數,它的值必須是 EOF 或表示為一個無符號字符。
如果參數 c 滿足描述的條件,則這些函數返回非零(true)。如果參數 c 不滿足描述的條件,則這些函數返回零。
## 庫函數
下面列出了頭文件 ctype.h 中定義的函數:
| 函數 | 描述 |
| --- | --- |
| [int isalnum(int c)](c-function-isalnum.html) | 該函數檢查所傳的字符是否是字母和數字。 |
| [int isalpha(int c)](c-function-isalpha.html) | 該函數檢查所傳的字符是否是字母。 |
| [int iscntrl(int c)](c-function-iscntrl.html) | 該函數檢查所傳的字符是否是控制字符。 |
| [int isdigit(int c)](c-function-isdigit.html) | 該函數檢查所傳的字符是否是十進制數字。 |
| [int isgraph(int c)](c-function-isgraph.html) | 該函數檢查所傳的字符是否有圖形表示法。 |
| [int islower(int c)](c-function-islower.html) | 該函數檢查所傳的字符是否是小寫字母。 |
| [int isprint(int c)](c-function-isprint.html) | 該函數檢查所傳的字符是否是可打印的。 |
| [int ispunct(int c)](c-function-ispunct.html) | 該函數檢查所傳的字符是否是標點符號字符。 |
| [int isspace(int c)](c-function-isspace.html) | 該函數檢查所傳的字符是否是空白字符。 |
| [int isupper(int c)](c-function-isupper.html) | 該函數檢查所傳的字符是否是大寫字母。 |
| [int isxdigit(int c)](c-function-isxdigit.html) | 該函數檢查所傳的字符是否是十六進制數字。 |
標準庫還包含了兩個轉換函數,它們接受并返回一個 "int"
| 函數 | 描述 |
| --- | --- |
| [int tolower(int c)](c-function-tolower.html) | 該函數把大寫字母轉換為小寫字母。 |
| [int toupper(int c)](c-function-toupper.html) | 該函數把小寫字母轉換為大寫字母。 |
## 字符類
| 字符類 | 描述 |
| --- | --- |
| **數字** | 完整的數字集合 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } |
| **十六進制數字** | 集合 { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f } |
| **小寫字母** | 集合 { a b c d e f g h i j k l m n o p q r s t u v w x y z } |
| **大寫字母** | 集合 {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z } |
| **字母** | 小寫字母和大寫字母的集合 |
| **字母數字字符** | 數字、小寫字母和大寫字母的集合 |
| **標點符號字符** | 集合 ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ |
| **圖形字符** | 字母數字字符和標點符號字符的集合 |
| **空格字符** | 制表符、換行符、垂直制表符、換頁符、回車符、空格符的集合。 |
| **可打印字符** | 字母數字字符、標點符號字符和空格字符的集合。 |
| **控制字符** | 在 ASCII 編碼中,這些字符的八進制代碼是從 000 到 037,以及 177(DEL)。 |
| **空白字符** | 包括空格符和制表符。 |
| **字母字符** | 小寫字母和大寫字母的集合。 |
- C語言教程
- C 簡介
- C 環境設置
- C 程序結構
- C 基本語法
- C 數據類型
- C 變量
- C 常量
- C 存儲類
- C 運算符
- C 判斷
- C 循環
- C 函數
- C 作用域規則
- C 數組
- C 指針
- C 字符串
- C 結構體
- C 共用體
- C 位域
- C typedef
- C 輸入 & 輸出
- C 文件讀寫
- C 預處理器
- C 頭文件
- C 強制類型轉換
- C 錯誤處理
- C 遞歸
- C 可變參數
- C 內存管理
- C 命令行參數
- C語言參考
- C 標準庫 - <assert.h>
- C 庫宏 - assert()
- C 標準庫 - <ctype.h>
- C 庫函數 - isalnum()
- C 庫函數 - isalpha()
- C 庫函數 - iscntrl()
- C 庫函數 - isdigit()
- C 庫函數 - isgraph()
- C 庫函數 - islower()
- C 庫函數 - isprint()
- C 庫函數 - ispunct()
- C 庫函數 - isspace()
- C 庫函數 - isupper()
- C 庫函數 - isxdigit()
- C 標準庫 - <errno.h>
- C 庫宏 - errno
- C 庫宏 - EDOM
- C 庫宏 - ERANGE
- C 標準庫 - <float.h>
- C 標準庫 - <limits.h>
- C 標準庫 - <locale.h>
- C 庫函數 - setlocale()
- C 庫函數 - localeconv()
- C 標準庫 - <math.h>
- C 庫函數 - acos()
- C 庫函數 - asin()
- C 庫函數 - atan()
- C 庫函數 - atan2()
- C 庫函數 - cos()
- C 庫函數 - cosh()
- C 庫函數 - sin()
- C 庫函數 - sinh()
- C 庫函數 - tanh()
- C 庫函數 - exp()
- C 庫函數 - frexp()
- C 庫函數 - ldexp()
- C 庫函數 - log()
- C 庫函數 - log10()
- C 庫函數 - modf()
- C 庫函數 - pow()
- C 庫函數 - sqrt()
- C 庫函數 - ceil()
- C 庫函數 - fabs()
- C 庫函數 - floor()
- C 庫函數 - fmod()
- C 標準庫 - <setjmp.h>
- C 庫宏 - setjmp()
- C 庫函數 - longjmp()
- C 標準庫 - <signal.h>
- C 庫函數 - signal()
- C 庫函數 - raise()
- C 標準庫 - <stdarg.h>
- C 庫宏 - va_start()
- C 庫宏 - va_arg()
- C 庫宏 - va_end()
- C 標準庫 - <stddef.h>
- C 庫宏 - NULL
- C 庫宏 - offsetof()
- C 標準庫 - <stdio.h>
- C 庫函數 - fclose()
- C 庫函數 - clearerr()
- C 庫函數 - feof()
- C 庫函數 - ferror()
- C 庫函數 - fflush()
- C 庫函數 - fgetpos()
- C 庫函數 - fopen()
- C 庫函數 - fread()
- C 庫函數 - freopen()
- C 庫函數 - fseek()
- C 庫函數 - fsetpos()
- C 庫函數 - ftell()
- C 庫函數 - fwrite()
- C 庫函數 - remove()
- C 庫函數 - rename()
- C 庫函數 - rewind()
- C 庫函數 - setbuf()
- C 庫函數 - tmpfile()
- C 庫函數 - tmpnam()
- C 庫函數 - fprintf()
- C 庫函數 - printf()
- C 庫函數 - sprintf()
- C 庫函數 - vfprintf()
- C 庫函數 - vprintf()
- C 庫函數 - vsprintf()
- C 庫函數 - fscanf()
- C 庫函數 - scanf()
- C 庫函數 - sscanf()
- C 庫函數 - fgetc()
- C 庫函數 - fgets()
- C 庫函數 - fputc()
- C 庫函數 - fputs()
- C 庫函數 - getc()
- C 庫函數 - getchar()
- C 庫函數 - gets()
- C 庫函數 - putc()
- C 庫函數 - putchar()
- C 庫函數 - puts()
- C 庫函數 - ungetc()
- C 庫函數 - perror()
- C 標準庫 - <stdlib.h>
- C 庫函數 - atof()
- C 庫函數 - atoi()
- C 庫函數 - atol()
- C 庫函數 - strtod()
- C 庫函數 - strtol()
- C 庫函數 - strtoul()
- C 庫函數 - calloc()
- C 庫函數 - free()
- C 庫函數 - malloc()
- C 庫函數 - realloc()
- C 庫函數 - abort()
- C 庫函數 - atexit()
- C 庫函數 - exit()
- C 庫函數 - getenv()
- C 庫函數 - system()
- C 庫函數 - bsearch()
- C 庫函數 - qsort()
- C 庫函數 - abs()
- C 庫函數 - div()
- C 庫函數 - labs()
- C 庫函數 - ldiv()
- C 庫函數 - rand()
- C 庫函數 - srand()
- C 庫函數 - mblen()
- C 庫函數 - mbstowcs()
- C 庫函數 - mbtowc()
- C 庫函數 - wcstombs()
- C 庫函數 - wctomb()
- C 標準庫 - <string.h>
- C 庫函數 - memchr()
- C 庫函數 - memcmp()
- C 庫函數 - memcpy()
- C 庫函數 - memmove()
- C 庫函數 - memset()
- C 庫函數 - strcat()
- C 庫函數 - strncat()
- C 庫函數 - strchr()
- C 庫函數 - strcmp()
- C 庫函數 - strncmp()
- C 庫函數 - strcoll()
- C 庫函數 - strcpy()
- C 庫函數 - strncpy()
- C 庫函數 - strcspn()
- C 庫函數 - strerror()
- C 庫函數 - strlen()
- C 庫函數 - strpbrk()
- C 庫函數 - strrchr()
- C 庫函數 - strspn()
- C 庫函數 - strstr()
- C 庫函數 - strtok()
- C 庫函數 - strxfrm()
- C 標準庫 - <time.h>
- C 庫函數 - asctime()
- C 庫函數 - clock()
- C 庫函數 - ctime()
- C 庫函數 - difftime()
- C 庫函數 - gmtime()
- C 庫函數 - localtime()
- C 庫函數 - mktime()
- C 庫函數 - strftime()
- C 庫函數 - time()
- 免責聲明