Espaces de noms
Variantes
Affichages
Actions

LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME

De cppreference.com
< c‎ | locale

 
 
Support de localisation
setlocale
localeconv
lconv
Catégories de locales
Original:
Locale categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_ALL
LC_COLLATE
LC_CTYPE
LC_MONETARY
LC_NUMERIC
LC_TIME
 
Defined in header <locale.h>
#define LC_ALL      /*implementation defined*/
#define LC_COLLATE  /*implementation defined*/
#define LC_CTYPE    /*implementation defined*/
#define LC_MONETARY /*implementation defined*/
#define LC_NUMERIC  /*implementation defined*/
#define LC_TIME     /*implementation defined*/
Chacun des constantes macro-dessus s'étendre à des expressions constantes entières avec des valeurs distinctes qui conviennent pour une utilisation en tant que premier argument de setlocale .
Original:
Each of the above macro constants expand to integer constant expressions with distinct values that are suitable for use as the first argument of setlocale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constante
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
LC_ALL
sélectionne la locale C ensemble
Original:
selects the entire C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_COLLATE
sélectionne la catégorie de classement de l'environnement local C
Original:
selects the collation category of the C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_CTYPE
sélectionne la catégorie classification des caractères de la locale C
Original:
selects the character classification category of the C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_MONETARY
sélectionne la catégorie formatage monétaire de la locale C
Original:
selects the monetary formatting category of the C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_NUMERIC
sélectionne la catégorie mise en forme numérique de la localisation C
Original:
selects the numeric formatting category of the C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
LC_TIME
sélectionne la catégorie formatage moment de la locale C
Original:
selects the time formatting category of the C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes macro supplémentaires, avec des noms qui commencent par LC_ suivie par au moins une lettre majuscule, peut être définie dans locale.h. Par exemple, la spécification POSIX exige LC_MESSAGES et la bibliothèque C GNU définit en outre LC_PAPER, lc_name, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT et LC_IDENTIFICATION .
Original:
Additional macro constants, with names that begin with LC_ followed by at least one uppercase letter, may be defined in locale.h. For example, the POSIX specification requires LC_MESSAGES and the GNU C library additionally defines LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, and LC_IDENTIFICATION.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <stdio.h>
#include <locale.h>
#include <time.h>
#include <wchar.h>
 
int main()
{
    setlocale(LC_ALL, "en_US.UTF-8"); // the C locale will be the UTF-8 enabled English
    setlocale(LC_NUMERIC, "de_DE");   // decimal dot will be German
    setlocale(LC_TIME, "ja_JP");      // date/time formatting will be Japanese
    wchar_t str[100];
    time_t t = time(NULL);
    wcsftime(str, 100, L"%A %c", localtime(&t));
    wprintf(L"Number: %.2f\nDate: %Ls\n", 3.14, str);
}

Résultat :

Number: 3,14
Date: 月曜日 2011年12月19日 18時04分40秒

[modifier] Voir aussi

obtient et définit les paramètres régionaux actuels C
Original:
gets and sets the current C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
C++ documentation for locale categories