`

C中<ctype.h>库

 
阅读更多


标准库<ctype.h>

1 字符测试函数

1> 函数原型均为int isxxxx(int)
2> 参数为int, 任何实参均被提升成整型
3> 只能正确处理处于[0, 127]之间的值

isalpha  'A'~'Z', 'a'~'z'
isdigit  '0'~'9'
isxdigit '0'~'9', 'A'~'F', 'a'~'f'
isalnum  isalpha || isdigit

islower  'a'~'z'
isupper  'A'~'Z'

isspace
9  '\t'  (tab: 水平制表位)
10 '\n'  (line feed: 换行)
11 '\v'  (home: 垂直制表位)
12 '\f'  (form feed: 换页)
13 '\r'  (carriage return: 回车)
32  ' '  (space: 空格)

isgraph  33~126
isprint  isgraph || ' '
ispunct  isgraph && !isalnum
 
iscntrl  0~31, 127
 
2 字符映射函数

1> 函数原型为int toxxxx(int)
2> 对参数进行检测, 若符合范围则转换, 否则不变

int tolower(int); 'A'~'Z' ==> 'a'~'z'
int toupper(int); 'a'~'z' ==> 'A'~'Z'

分享到:
评论

相关推荐

    C语言函数库详解.doc

    C语言函数库,包含 C 标准库、IO 函数、字符处理函数、字符串函数、数学函数、时间和日期函数、其它函数等数百个常用的C语言函数,文档中对常用函数库的函数原型、详细功能、使用示例等进行了详细的介绍说明,。...

    C标准库文档,包括标准库中12个头文件的描述

    * &lt;ctype.h&gt; : Character Class Tests * &lt;errno.h&gt; : Error Codes Reported by (Some) Library Functions * &lt;float.h&gt; : Implementation-defined Floating-Point Limits * &lt;limits.h&gt; : Implementation-defined ...

    c语言设计Brian W. Kernighan Dennis M. Ritchie

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C标准库函数集.rar

    2 字符类测试 &lt;ctype.h&gt; . 19 3 字符串函数 &lt;string.h&gt; . 22 4 数学函数 &lt;math.h&gt; . . . . . . 29 5 实用函数 &lt;stdlib.h&gt; . . . . . 35 6 诊断 &lt;assert.h&gt; . 43 7 变长变元表 &lt;stdarg.h&gt; 44 8 非局部跳转 ...

    C_Standar_Library

    • &lt;ctype.h&gt; : Character Class Tests • &lt;errno.h&gt; : Error Codes Reported by (Some) Library Functions • &lt;float.h&gt; : Implementation-defined Floating-Point Limits • &lt;limits.h&gt; : Implementation-defined ...

    C语言基础教程TXT

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C和C++头文件对比一览

    #include &lt;ctype.h&gt; //字符处理 #include &lt;errno.h&gt; //定义错误码 #include &lt;float.h&gt; //浮点数处理 #include &lt;fstream.h&gt; //文件输入/输出 #include &lt;iomanip.h&gt; //参数化输入/输出 #include &lt;iostream.h&gt; ...

    c程序设计语言入门基础 @精品@ 花我一年才从众书中筛选出的

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C程序设计语言(第2版·新版)

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C程序设计语言 很适合初学者和再学者学习和复习

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C语言精典版本C程序设计语言

    B.2 字符类测试:&lt;ctype.h&gt; B.3 字符串函数:&lt;string.h&gt; B.4 数学函数:&lt;math.h&gt; B.5 实用函数:&lt;stdlib.h&gt; B.6 诊断:&lt;assert.h&gt; B.7 变量变元表:&lt;stdarg.h&gt; B.8 非局部跳转:&lt;setjmp.h&gt; B.9 信号处理:...

    C标准库源码解剖(3):字符处理函数ctype.h和wctype.h.pdf

    C标准库源码解剖(3):字符处理函数ctype.h和wctype.h.pdf

    utf8type.h:用C89编写的ctype.h的utf-8替代

    utf8type.h是一个库,旨在替代具有utf8意识的纯C89语言编写的ctype.h 。 库本身没有依赖关系,但是使用sqlite3的副本生成unicode_data.h文件(仅当您具有要使用的自定义UnicodeData.txt时才需要)。 目标是提供与...

    C标准库函数及详细函数定义

    C标准库: 1 输入与输出 &lt;stdio.h&gt; 2 字符类测试 &lt;ctype.h&gt; 3 字符串函数 &lt;string.h&gt; 4 数学函数 &lt;math.h&gt; 5 实用函数 &lt;stdlib.h&gt; 等等

    有关栈的输入,输出,删除,修改等

    #include &lt;ctype.h&gt; //打开库文件#include &lt;stdio.h&gt;#include &lt;iostream.h&gt;#include &lt;malloc.h&gt;#include &lt;process.h&gt;#include &lt;string.h&gt; #define error 0#define ok 1typedef struct{ int *base; int *top; int ...

    C标准库源代码(学习C/C++必备)

    C 标准库源代码\CTYPE.H C标准库源代码\CVT.H C标准库源代码\CWCHAR C标准库源代码\CWCTYPE C 标准库源代码\DAYS.C C标准库源代码\DBGDEL.CPP C标准库源代码\DBGHEAP.C C标准库源代码\DBGHOOK.C C标准库源代码\...

    C语言函数库手册 按函数功能快速查询

    转换子程序,函数库为math.h、stdlib.h、ctype.h、float.h char *ecvt(double value,int ndigit,int *decpt,int *sign)将浮点数value 转换成字符串并返回该字符串 char *fcvt(double value,int ndigit,int *decpt,int...

    C语言函数大全

    1.字符函数,所在函数库为ctype.h……………………………………………………………………2 2.数学函数,所在函数库为math.h、stdlib.h、string.h、float.h………………………………………2 3.目录函数,所在函数...

Global site tag (gtag.js) - Google Analytics