鍍金池/ 教程/ C/ <locale.h> - C語言標(biāo)準(zhǔn)庫
qsort() - C語言庫函數(shù)
strxfrm() - C語言庫函數(shù)
difftime() - C語言庫函數(shù)
isdigit() - C函數(shù)
<limits.h> - C語言標(biāo)準(zhǔn)庫
ldiv() - C語言庫函數(shù)
printf() - C語言庫函數(shù)
sin() - C函數(shù)
freopen() - C語言庫函數(shù)
NULL - C函數(shù)
mktime() - C語言庫函數(shù)
floor() - C函數(shù)
log() - C函數(shù)
rewind() - C語言庫函數(shù)
memcpy() - C語言庫函數(shù)
remove() - C語言庫函數(shù)
localtime() - C語言庫函數(shù)
strcoll() - C語言庫函數(shù)
fgets() - C語言庫函數(shù)
errno - C語言宏
<stdlib.h> - C語言標(biāo)準(zhǔn)庫
labs() - C語言庫函數(shù)
putchar() - C語言庫函數(shù)
wcstombs() - C語言庫函數(shù)
fclose() - C庫函數(shù)
system() - C語言庫函數(shù)
strncmp() - C語言庫函數(shù)
va_end() - C函數(shù)
setlocale() - C函數(shù)
strpbrk() - C語言庫函數(shù)
acos() - C函數(shù)
fabs() - C函數(shù)
asctime() - C語言庫函數(shù)
offsetof() - C函數(shù)
cos() - C函數(shù)
atoi() - C語言庫函數(shù)
strftime() - C語言庫函數(shù)
va_arg() - C函數(shù)
strstr() - C語言庫函數(shù)
<errno.h> - C語言標(biāo)準(zhǔn)庫
memchr() - C語言庫函數(shù)
fopen() - C語言庫函數(shù)
va_start() - C函數(shù)
fprintf() - C語言庫函數(shù)
strrchr() - C語言庫函數(shù)
<time.h> - C語言標(biāo)準(zhǔn)庫
C語言標(biāo)準(zhǔn)庫
isgraph() - C函數(shù)
srand() - C語言庫函數(shù)
isprint() - C函數(shù)
fputs() - C語言庫函數(shù)
sscanf() - C語言庫函數(shù)
getc() - C語言庫函數(shù)
<stdarg.h> - C語言標(biāo)準(zhǔn)庫
rename() - C語言庫函數(shù)
rand() - C語言庫函數(shù)
strspn() - C語言庫函數(shù)
frexp() - C函數(shù)
bsearch() - C語言庫函數(shù)
islower() - C函數(shù)
fwrite() - C語言庫函數(shù)
ispunct() - C函數(shù)
vsprintf() - C語言庫函數(shù)
strcspn() - C語言庫函數(shù)
fgetpos() - C庫函數(shù)
getchar() - C語言庫函數(shù)
tmpfile() - C語言庫函數(shù)
mbtowc() - C語言庫函數(shù)
sprintf() - C語言庫函數(shù)
ftell() - C語言庫函數(shù)
feof() - C庫函數(shù)
mblen() - C語言庫函數(shù)
clearerr() - C庫函數(shù)
modf() - C函數(shù)
strncat() - C語言庫函數(shù)
isspace() - C函數(shù)
ctime() - C語言庫函數(shù)
tmpnam() - C語言庫函數(shù)
isupper() - C函數(shù)
atol() - C語言庫函數(shù)
gets() - C語言庫函數(shù)
<setjmp.h> - C語言標(biāo)準(zhǔn)庫
perror() - C語言庫函數(shù)
exit() - C語言庫函數(shù)
memmove() - C語言庫函數(shù)
isalpha() - C函數(shù)
fsetpos() - C語言庫函數(shù)
fmod() - C函數(shù)
<float.h> - C語言標(biāo)準(zhǔn)庫
strtok() - C語言庫函數(shù)
wctomb() - C語言庫函數(shù)
strcat() - C語言庫函數(shù)
atof() - C語言庫函數(shù)
strchr() - C語言庫函數(shù)
<locale.h> - C語言標(biāo)準(zhǔn)庫
signal() - C函數(shù)
ungetc() - C語言庫函數(shù)
ferror() - C庫函數(shù)
C語言標(biāo)準(zhǔn)庫
strtoul() - C語言庫函數(shù)
fseek() - C語言庫函數(shù)
fscanf() - C語言庫函數(shù)
mbstowcs() - C語言庫函數(shù)
longjmp() - C函數(shù)
localeconv() - C函數(shù)
raise() - C函數(shù)
ceil() - C函數(shù)
<string.h> - C語言標(biāo)準(zhǔn)庫
free() - C語言庫函數(shù)
setvbuf() - C語言庫函數(shù)
atan() - C函數(shù)
C函數(shù)庫宏 assert()
<stdio.h> - C語言標(biāo)準(zhǔn)庫
fread() - C語言庫函數(shù)
vfprintf() - C語言庫函數(shù)
isxdigit() - C函數(shù)
toupper() - C函數(shù)
<ctype.h> - C語言標(biāo)準(zhǔn)庫
setjmp() - C函數(shù)
ldexp() - C函數(shù)
EDOM - C語言宏
strlen() - C語言庫函數(shù)
tolower() - C函數(shù)
clock() - C語言庫函數(shù)
fflush() - C庫函數(shù)
fgetc() - C語言庫函數(shù)
<stddef.h> - C語言標(biāo)準(zhǔn)庫
div() - C語言庫函數(shù)
<math.h> - C語言標(biāo)準(zhǔn)庫
isalnum() - C函數(shù)
memset() - C語言庫函數(shù)
calloc() - C語言庫函數(shù)
vprintf() - C語言庫函數(shù)
sqrt() - C函數(shù)
<assert.h> - C語言標(biāo)準(zhǔn)庫
time() C語言
atexit() - C語言庫函數(shù)
memcmp() - C語言庫函數(shù)
setbuf() - C語言庫函數(shù)
iscntrl() - C函數(shù)
abs() - C語言庫函數(shù)
abort() - C語言庫函數(shù)
exp() - C函數(shù)
realloc() - C語言庫函數(shù)
puts() - C語言庫函數(shù)
scanf() - C語言庫函數(shù)
malloc() - C語言庫函數(shù)
strerror() - C語言庫函數(shù)
strtol() - C語言庫函數(shù)
ERANGE - C語言宏
sinh() - C函數(shù)
atan2() - C函數(shù)
putc() - C語言庫函數(shù)
asin() - C函數(shù)
strcpy() - C語言庫函數(shù)
fputc() - C語言庫函數(shù)
getenv() - C語言庫函數(shù)
pow() - C函數(shù)
tanh() - C函數(shù)
gmtime() - C語言庫函數(shù)
strtod() - C語言庫函數(shù)
log10() - C函數(shù)
strcmp() - C語言庫函數(shù)
<signal.h> - C語言標(biāo)準(zhǔn)庫

<locale.h> - C語言標(biāo)準(zhǔn)庫

locale.h頭文件定義了特定的位置設(shè)置,如日期格式和貨幣符號(hào)。有一個(gè)重要的結(jié)構(gòu)struct lconv和兩個(gè)重要的函數(shù),下面列出一些宏定義。

庫宏

以下是在標(biāo)頭中定義的宏,這些宏將被用在下面列出的兩個(gè)函數(shù):

S.N. 宏及說明
1 LC_ALL
Set everything.
2 LC_COLLATE
Affects strcoll and strxfrm functions.
3 LC_CTYPE
Affects all character functions.
4 LC_MONETARY
Affects the monetary information provided by localeconv function.
5 LC_NUMERIC
Affects decimal-yiibai formatting and the information provided by localeconv function.
6 LC_TIME
Affects the strftime function.

庫函數(shù)

以下是頭locale.h中定義的函數(shù):

S.N. 功能及說明
1 char *setlocale(int category, const char *locale)
設(shè)置或讀取位置相關(guān)的信息。
2 struct lconv *localeconv(void)
設(shè)置或讀取位置相關(guān)的信息。

庫結(jié)構(gòu)

typedef struct {
   char *decimal_yiibai;
   char *thousands_sep;
   char *grouping;	
   char *int_curr_symbol;
   char *currency_symbol;
   char *mon_decimal_yiibai;
   char *mon_thousands_sep;
   char *mon_grouping;
   char *positive_sign;
   char *negative_sign;
   char int_frac_digits;
   char frac_digits;
   char p_cs_precedes;
   char p_sep_by_space;
   char n_cs_precedes;
   char n_sep_by_space;
   char p_sign_posn;
   char n_sign_posn;
} lconv

以下是每個(gè)字段的描述:

S.N. 字段&說明
1 decimal_yiibai
Decimal yiibai character used for non-monetary values.
2 thousands_sep
Thousands place separator character used for non-monetary values..
3 grouping
A string that indicates the size of each group of digits in non-monetary quantities. Each character represents an integer value which designates the number of digits in the current group. A value of 0 means that the previous value is to be used for the rest of the groups.
4 int_curr_symbol
A string of the international currency symbols used. The first three characters are those specified by ISO 4217:1987 and the fourth is the character which separates the currency symbol from the monetary quantity.
5 currency_symbol
The local symbol used for currency.
6 mon_decimal_yiibai
The decimal yiibai character used for monetary values.
7 mon_thousands_sep
The thousands place grouping character used for monetary values.
8 mon_grouping
A string whose elements define the size of the grouping of digits in monetary values. Each character represents an integer value which designates the number of digits in the current group. A value of 0 means that the previous value is to be used for the rest of the groups.
9 positive_sign
The character used for positive monetary values.
10 negative_sign
The character used for negative monetary values.
11 int_frac_digits
Number of digits to show after the decimal yiibai in international monetary values.
12 frac_digits
Number of digits to show after the decimal yiibai in monetary values.
13 p_cs_precedes
If equal to 1, then the currency_symbol appears before a positive monetary value. If equal to 0, then the currency_symbol appears after a positive monetary value.
14 p_sep_by_space
If equal to 1, then the currency_symbol is separated by a space from a positive monetary value. If equal to 0, then there is no space between the currency_symbol and a positive monetary value.
15 n_cs_precedes
If equal to 1, then the currency_symbol precedes a negative monetary value. If equal to 0, then the currency_symbol succeeds a negative monetary value.
16 n_sep_by_space
If equal to 1, then the currency_symbol is separated by a space from a negative monetary value. If equal to 0, then there is no space between the currency_symbol and a negative monetary value.
17 p_sign_posn
Represents the position of the positive_sign in a positive monetary value.
18 n_sign_posn
Represents the position of the negative_sign in a negative monetary value.

使用以下值為p_sign_posn和n_sign_posn:

描述
0 括號(hào)封裝值和CURRENCY_SYMBOL的。the currency_symbol.
1 符號(hào)之前的值和currency_symbol.
2 該標(biāo)志成功的值和currency_symbol.
3 符號(hào)立即之前的值和 currency_symbol.
4 符號(hào)立即成功的值和currency_symbol.