setlocale
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <locale.h>
|
||
char* setlocale( int category, const char* locale); |
||
La funzione
setlocale installa la versione locale specificata sistema o sua porzione, come la nuova versione locale C. Le modifiche rimangono attive e influenza l'esecuzione di tutti i dipendenti dalle impostazioni internazionali funzioni di libreria C fino alla successiva chiamata a setlocale. Se locale è un puntatore nullo, setlocale interroga il locale corrente C senza modificarlo.Original:
The
setlocale function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and influences the execution of all locale-sensitive C library functions until the next call to setlocale. If locale is a null pointer, setlocale queries the current C locale without modifying it.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parametri
| category | - | locale identificatore di categoria, una delle macro
LC_xxx . Può essere nullo .Original: LC_xxx The text has been machine-translated via [http://translate.google.com Google Translate]. You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions. Original: locale category identifier, one of the LC_xxx macros. May be null.Original: LC_xxx The text has been machine-translated via [http://translate.google.com Google Translate]. You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| locale | - | specifico del sistema identificatore delle impostazioni locali. Può essere
"" per l'utente-locale preferito o "C" per le impostazioni minime Original: system-specific locale identifier. Can be "" for the user-preferred locale or "C" for the minimal locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Valore di ritorno
puntatore ad una stretta stringa con terminazione null che identifica la versione locale C dopo aver applicato le modifiche, se del caso, o un puntatore nullo in caso di fallimento.
Original:
pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Note
Durante l'avvio del programma, l'equivalente di
setlocale(LC_ALL, "C"); viene eseguito prima di qualsiasi codice utente viene eseguito.Original:
During program startup, the equivalent of
setlocale(LC_ALL, "C"); is executed before any user code is run.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Anche se il tipo di ritorno è
char*, modificando le punta-a caratteri è un comportamento indefinito.Original:
Although the return type is
char*, modifying the pointed-to characters is undefined behavior.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Perché
setlocale modifica lo stato globale che colpisce l'esecuzione di funzioni dipendenti dalle impostazioni internazionali, è un comportamento indefinito di chiamare da un thread, mentre un altro thread sta eseguendo una qualsiasi delle seguenti funzioni: fprintf, isprint, iswdigit, localeconv, tolower, fscanf, ispunct, iswgraph, mblen, toupper, isalnum, isspace, iswlower, mbstowcs, towlower, isalpha, isupper, iswprint, mbtowc, towupper, isblank, iswalnum, iswpunct, setlocale, wcscoll, iscntrl, iswalpha, iswspace, strcoll, wcstod, isdigit, iswblank, iswupper, strerror, wcstombs, isgraph, iswcntrl, iswxdigit, strtod, wcsxfrm, islower, iswctype, isxdigit.Original:
Because
setlocale modifies global state which affects execution of locale-dependent functions, it is undefined behavior to call it from one thread, while another thread is executing any of the following functions: fprintf, isprint, iswdigit, localeconv, tolower, fscanf, ispunct, iswgraph, mblen, toupper, isalnum, isspace, iswlower, mbstowcs, towlower, isalpha, isupper, iswprint, mbtowc, towupper, isblank, iswalnum, iswpunct, setlocale, wcscoll, iscntrl, iswalpha, iswspace, strcoll, wcstod, isdigit, iswblank, iswupper, strerror, wcstombs, isgraph, iswcntrl, iswxdigit, strtod, wcsxfrm, islower, iswctype, isxdigit.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Esempio
| This section is incomplete Reason: no example |
Vedi anche
le categorie di locale per setlocaleOriginal: locale categories for setlocaleThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro costante) | |
C++ documentation for setlocale
| |