Skip to Content
C语言核心技术(原书第2版)
book

C语言核心技术(原书第2版)

by Peter Prinz, Tony Crawford
August 2017
Intermediate to advanced
798 pages
17h 44m
Chinese
China Machine Press
Content preview from C语言核心技术(原书第2版)
318
|
第
17
章
实现版本也可以定义其他字符串,以指定区域专用的字符分类。
17.3.2 字符映射
表
17-14
中的函数可以将小写字母转换为对应的大写字母,或把大写字母转换为对应的小
写字母。如果接收其他参数,将直接返回,不受转换影响。
表17-14:字符转换函数
转换 在ctype.h中的函数 在wctype.h中的函数
大写转小写
tolower() towlower()
小写转大写
toupper() towupper()
这里如同前面小节介绍的,头文件
wctype.h
声明了另外两个扩展函数,以用来转换宽字
符,如表
17-15
所示。通过给定的实现版本所支持的每种字符转换都由字符串指定。
表17-15:扩展字符转换函数
目的 函数
将一个用来指定字符分类的字符串参数映射到一个标量值
,
wctrans()
以便作为
towctrans()
的第二个参数
对给定的宽字符进行第二个参数所指定的转换
towctrans()
表
17-14
所列函数的功能都可以用表
17-15
中所列的两个函数实现。指定表示这些转换的
字符串是“
tolower
”和“
toupper
”。因此,对宽字符
wc
而言,下面两个函数调用语句返
回相同的结果:
towupper( wc );
towctrans( wc, wctrans("toupper") );
实现版本也可以定义其他字符串,以指定区域专用的字符分类。
17.4 字符串处理
字符串是一个连续的字符序列,以
'\0'
字符作为终止符。字符串长度指的是字符个数,但
不计终止符。字符串可以是一个字节字符串( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)

Publisher Resources

ISBN: 9787111562207