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版)
326
|
第
17
章
所有程序开始时都使用默认的区域,命名为“
C
”,它不包括任何国家或语言专用的信
息。在运行时,程序可以改变它们的区域,或查询当前区域信息。区域信息划分成许多
类,可以分别查询和设置这些区域类。
在头文件
locale.h
中,声明了处理当前区域的函数,以及相关的类型与宏。函数如表
17-26
所示。
表17-26:区域函数
目的 函数
针对特定的区域类信息
,
查询或设置区域
setlocale()
针对数字与货币字符串
,
获得区域格式惯例信息
localeconv()
许多函数会使用区域专用的信息。在第
18
章标准库函数描述中指出了函数何时会用到区
域设置。这些函数大致上包括:
•
字符分类与大小写映射相关的函数
•
受区域影响的字符串比较函数(
strcoll()
和
wcscoll()
)
•
日期与时间格式函数(
strftime()
和
wcsftime()
)
•
数字字符串转换函数
•
多字节字符和宽字符转换函数
17.13 非本地跳转
C
语言中的
goto
语句只能够在函数内跳转。如想拥有更大的自由,头文件
setjmp.h
中声明
了一对函数,它们允许跳转到程序内的任一位置。表
17-27
列出了这对函数。
表17-27:非本地性跳转函数
目的 函数
为函数
longjmp()
,
把当前执行背景存储到一个跳转对象
setjmp()
跳转到先前调用函数
setjmp()
所存储的执行背景
longjmp()
当调用类函数宏
setjmp()
的时候,它会在类型为
jmp_buf
的参
数中存储一个值,该值类
似于一条书签,它指向程序的跳转点。该 ...
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