c_c++ :字符处理

头文件: cctype    (ctype.h)

说明: 字符处理库
功能一:字符测试
1> 函数原型均为int isxxxx(int)
2> 参数为int, 任何实参均被提升成整型
3> 只能正确处理处于[0, 127]之间的值
 

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

For the first set, here is a map of how theoriginal 127-character ASCII set is considered by each function (an x indicatesthat the function returns true on that character)

ASCII values

characters

iscntrl

isspace

isupper

islower

isalpha

isdigit

isxdigit

isalnum

ispunct

isgraph

isprint

0x00 .. 0x08

NUL, (other control codes)

x

 

 

 

 

 

 

 

 

 

 

0x09 .. 0x0D

(white-space control codes: '\t','\f','\v','\n','\r')

x

x

 

 

 

 

 

 

 

 

 

0x0E .. 0x1F

(other control codes)

x

 

 

 

 

 

 

 

 

 

 

0x20

space (' ')

 

x

 

 

 

 

 

 

 

 

x

0x21 .. 0x2F

!"#$%&'()*+,-./

 

 

 

 

 

 

 

 

x

x

x

0x30 .. 0x39

01234567890

 

 

 

 

 

x

x

x

 

x

x

0x3a .. 0x40

:;<=>?@

 

 

 

 

 

 

 

 

x

x

x

0x41 .. 0x46

ABCDEF

 

 

x

 

x

 

x

x

 

x

x

0x47 .. 0x5A

GHIJKLMNOPQRSTUVWXYZ

 

 

x

 

x

 

 

x

 

x

x

0x5B .. 0x60

[\]^_`

 

 

 

 

 

 

 

 

x

x

x

0x61 .. 0x66

abcdef

 

 

 

x

x

 

x

x

 

x

x

0x67 .. 0x7A

ghijklmnopqrstuvwxyz

 

 

 

x

x

 

 

x

 

x

x

0x7B .. 0x7E

{|}~

 

 

 

 

 

 

 

 

x

x

x

0x7F

(DEL)

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值