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版)
288
|
第
16
章
头文件
limits.h
还定义了下面两个宏:
CHAR_BIT
一个字节拥有的位数,该值最少为
8
。
MB_LEN_MAX
一个多字节字符最大位数,该值最少为
1
。
宏
CHAR_BIT
的值决定了
UCHAR_MAX
的值:
UCHAR_MAX
等同于
2
CHAR_BIT
-
1
。
MB_LEN_MAX
的值大于或等于
MB_CUR_MAX
的值,其中后者定义在头文件
stdlib.h
中。
MB_
CUR_MAX
表示了在当前区域下一个多字节字符的最大位数,这个值受针对
LC_CTYPE
类的
区域设置的影响(详细情况请参见第
18
章中有关
setlocale()
的介
绍)。如果当前区域
使用状态多字节编码,那么
MB_LEN_MAX
和
MB_CUR_MAX
包括在实际多字节字符之前状态移
位序列所必需的字节数量。
locale.h
标准库支持适应区域文化惯例的
C
程序。例如,程序可以使用区域专用的字符集或货币
格式。
头文件
locale.h
声明了两个函数、类型
struct lconv
、用于表
示空指针常量的宏
NULL
,
以及以
LC_
开头的、表示区域信息的宏。
函数
setlocale()
允许
查询或设置当前区域。与区域的相关信息被分成许多类别,可以
独立地查询与设定每个类。下面的整数宏被定义用于指定这些类别:
LC_ALL LC_COLLATE LC_CTYPE
LC_MONETARY LC_NUMERIC LC_TIME
函数
setlocale()
将上述其中一个宏作为第一个参数,然后在对应的区域类上进行操
作。这些宏的含义请参见第 ...
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