Espacios de nombres
Variantes
Acciones

setlocale

De cppreference.com
< c‎ | locale

Defined in header <locale.h>
char* setlocale( int category, const char* locale);
La función setlocale instala la configuración regional del sistema especificado o su porción como el nuevo entorno nacional C. Las modificaciones permanecerán vigentes e influye en la ejecución de todas las funciones de la biblioteca C sensibles al entorno local hasta la siguiente llamada a setlocale. locale Si es un puntero nulo, setlocale consulta el entorno nacional C actual sin 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.

Contenido

[editar] Parámetros

category - . Puede ser nulo .
Original:
locale -
específica del sistema de identificador de configuración regional. Puede ser "" para la configuración regional preferido por el usuario o "C" para la configuración regional mínimo
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.

[editar] Valor de retorno

puntero a una estrecha cadena de terminación nula identificación de la configuración regional C después de aplicar los cambios, si los hubiere, o de puntero nulo en caso de fallo .
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.

[editar] Notas

Durante el inicio del programa, el equivalente a setlocale(LC_ALL, "C"); se ejecuta antes de cualquier código de usuario que se ejecuta .
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.
Aunque el tipo de retorno es char*, la modificación de los caracteres apuntados a un comportamiento no definido .
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.
Porque setlocale modifica mundial Estado que afecta a la ejecución de las funciones que dependen de la configuración regional, es un comportamiento indefinido para llamarlo de un hilo, mientras que otro hilo está ejecutando cualquiera de las siguientes funciones: 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.

[editar] Ejemplo

[editar] Ver también

categorías de entorno local 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) [edit]
C++ documentation for setlocale