黄色电影一区二区,韩国少妇自慰A片免费看,精品人妻少妇一级毛片免费蜜桃AV按摩师 ,超碰 香蕉

C語言 庫函數(shù) localeconv()

C語言 庫函數(shù) localeconv()

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

C 庫函數(shù) struct lconv *localeconv(void) 設(shè)置或讀取地域化信息。它會(huì)返回一個(gè) lconv 結(jié)構(gòu)類型的對象。

 

1. 聲明

下面是 localeconv() 函數(shù)的聲明。

struct lconv *localeconv(void)

 

2. 參數(shù)

  • NA

 

3. 返回值

該函數(shù)返回一個(gè)指向當(dāng)前區(qū)域 struct lconv 的指針,它的結(jié)構(gòu)如下:

typedef struct {
   char *decimal_point;
   char *thousands_sep;
   char *grouping;	
   char *int_curr_symbol;
   char *currency_symbol;
   char *mon_decimal_point;
   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

 

4 實(shí)例

下面的實(shí)例演示了 localeconv() 函數(shù)的用法。

#include <locale.h>
#include <stdio.h>

int main ()
{
   struct lconv * lc;

   setlocale(LC_MONETARY, "it_IT");
   lc = localeconv();
   printf("Local Currency Symbol: %s\n",lc->currency_symbol);
   printf("International Currency Symbol: %s\n",lc->int_curr_symbol);

   setlocale(LC_MONETARY, "en_US");
   lc = localeconv();
   printf("Local Currency Symbol: %s\n",lc->currency_symbol);
   printf("International Currency Symbol: %s\n",lc->int_curr_symbol);

   setlocale(LC_MONETARY, "en_GB");
   lc = localeconv();
   printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
   printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);

   printf("Decimal Point = %s\n", lc->decimal_point);
   
   return 0;
}

讓我們編譯并運(yùn)行上面的程序,這將產(chǎn)生以下結(jié)果:

Local Currency Symbol: EUR
International Currency Symbol: EUR
Local Currency Symbol: $
International Currency Symbol: USD
Local Currency Symbol: £
International Currency Symbol: GBP
Decimal Point = .

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

下一節(jié):C 標(biāo)準(zhǔn)庫 <math.h>

C 簡介

相關(guān)文章