名前空間
変種
操作

setlocale

提供: cppreference.com
< c‎ | locale

Defined in header <locale.h>
char* setlocale( int category, const char* locale);
setlocale関数は、新しいCロケールとして指定されているシステムのロケールまたはその一部をインストールします。修正は引き続き有効であるとsetlocaleへの次のコールまで、ロケールに依存するすべてのCライブラリ関数の実行に影響を与えます。 localeがNULLポインターである場合、setlocaleは、それを変更することなく、現在のCロケールを照会.
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.

目次

[編集] パラメータ

category - マクロの一つ。 nullの可能性があります.
Original:
locale -
システム固有のロケール識別子。最小限のロケール用のユーザの優先ロケールまたは""ため"C"することができます
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.

[編集] 値を返します

変更を適用した後のCロケールを識別狭いNULLで終わる文字列があれば、失敗した場合はNULLポインタへのポインタ..
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.

[編集] ノート

任意のユーザコードが実行される前に、プログラムの起動時に、setlocale(LC_ALL, "C");のと同じ処理が実行され.
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.
戻り値の型がchar*ですが、ポイント先の文字を変更すると、未定義の動作です.
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.
setlocaleはロケールに依存した機能の実行に影響を与えるグローバルな状態を変更するので、別のスレッドが次のいずれかの機能を実行している間、それは、一つのスレッドからそれを呼び出すように未定義の動作です:fprintfisprintiswdigitlocaleconvtolowerfscanfispunctiswgraphmblentoupperisalnumisspaceiswlowermbstowcstowlowerisalphaisupperiswprintmbtowctowupperisblankiswalnumiswpunctsetlocalewcscolliscntrliswalphaiswspacestrcollwcstodisdigitiswblankiswupperstrerrorwcstombsisgraphiswcntrliswxdigitstrtodwcsxfrmisloweriswctypeisxdigit.
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.

[編集]

[編集] も参照してください

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.

(マクロ定数) [edit]
C++ documentation for setlocale