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版)
488
|
第
18
章
localeconv
获得当前区域的惯用形式。
#include <locale.h>
struct lconv
*localeconv
( void );
函数
localeconv()
返回一个指针,该指针指向一个结构,该结构包含针对格式化数字和
货币的指定区域惯用形式的完整信息。该返回值反映了当前区域的惯用形式,可以通过
函数
setlocale()
查
询或修改当前区域设置。
传递到函数
localeconv()
的结构具有类型
struct lconv
,
该结构类型定义在头文件
locale.h
中。该结构的成员描述了在该区域中如何格式化货币与非货币的数字。在
C99
标
准中,有两组信息集可以描述货币格式:一组描述本地用法,另一组描述国际用法,国
际用法需要标准的字母货币符号,并且也可以使用不同数量的小数点位数。
该结构中成员的全集以及它们在结构中的顺序,会因采用的实现版本的不同而各有差
异,但是无论哪种实现版本,该结构必须包括以下成员:
char *decimal_point
;
货币以外的小数点字符。在
C
的默认区域中,该指针指向
"."
的值。
char *thousands_sep
;
数字分结符又称“千分号”,例如,
"65,536"
中的英文逗号。无论采用什么名字,
并非所有区域都以三位数进行数字的分结,例如,请参见下一个成员
grouping
。
char *grouping
;
该指针所引用的内容不是一个文本字符串,而是一个数字
char
值的数组,它具有下
列意义:数组的第一个元素是最右侧数字分结的数字个数。数组中后续每个元素都 ...
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