setlocale
Da cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <locale.h>
|
||
| char* setlocale( int category, const char* locale); |
||
A função
setlocale instala a localidade do sistema especificado ou a sua parte como a localidade C novo. As modificações continuam em vigor e influencia a execução de todos os sensíveis à localidade funções de biblioteca C até a próxima chamada para setlocale. Se locale é um ponteiro nulo, setlocale consulta a localidade C atual, sem modificá-lo.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.
Índice |
[editar] Parâmetros
[editar] Valor de retorno
ponteiro para uma string terminada em null estreita identificação da localidade C depois de aplicar as alterações, se houver, ou ponteiro nulo em caso de falha.
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.
[editar] Notas
Durante a inicialização do programa, o equivalente a setlocale(LC_ALL, "C"); é executada antes de qualquer código de usuário é executado.
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.
Embora o tipo de retorno é char*, modificando os personagens apontados é um comportamento indefinido.
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.
Porque
setlocale modifica o estado global, que afeta a execução da localidade funções dependentes, é um comportamento indefinido para chamá-lo a partir de um fio, enquanto outro segmento é a execução de qualquer das seguintes funções: 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.
[editar] Exemplo
| This section is incomplete Reason: no example |
[editar] Veja também
| categorias locais para setlocale Original: locale categories for setlocale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (macro constante) | |
| C++ documentation for setlocale
| |