名前空間
変種
操作

wcstombs

提供: cppreference.com
< c‎ | string‎ | multibyte

Defined in header <stdlib.h>
size_t wcstombs( char* dst, const wchar_t* src, size_t len)
最初の要素は初期シフト状態で始まるその狭いマルチバイト表現にsrcによって指された配列のワイド文字のシーケンスに変換します。変換された文字はdstが指すchar型の配列の連続する要素に格納されています。 lenバイト以上は、コピー先の配列に書き込まれません.
Original:
Converts a sequence of wide characters from the array whose first element is pointed to by src to its narrow multibyte representation that begins in the initial shift state. Converted characters are stored in the successive elements of the char array pointed to by dst. No more than len bytes are written to the destination array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
各文字は、wctomb関数の変換状態が影響を受けないことを除けば、wctombへの呼び出しと同じように変換されます。次の場合、変換は終了します
Original:
Each character is converted as if by a call to wctomb, except that the wctomb's conversion state is unaffected. The conversion stops if:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ヌル文字が変換されて格納されていた.
    Original:
    The null character was converted and stored.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • wchar_tは、現在のCロケールで有効な文字に対応していないことが判明した.
    Original:
    A wchar_t was found that does not correspond to a valid character in 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.
  • 格納する次のマルチバイト文字がlenを超えてしまう.
    Original:
    The next multibyte character to be stored would exceed len.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目次

[編集] ノート

それは文字列を使用して処理するときに、ほとんどの実装では、この関数は、型mbstate_tのグローバルな静的オブジェクトを更新し、2つのスレッドで同時に呼び出すことはできません、wcsrtombsは、そのような場合に使用されるべき.
Original:
In most implementations, this function updates a global static object of type mbstate_t as it processes through the string, and cannot be called simultaneously by two threads, wcsrtombs should be used in such cases.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
POSIXは、一般的な拡張子を指定します。dstがNULLポインターである場合、この関数は、変換された場合、dstに書き込まれるバイト数を返します。同様の現象がwcsrtombsするための標準規格です.
Original:
POSIX specifies a common extension: if dst is a null pointer, this function returns the number of bytes that would be written to dst, if converted. Similar behavior is standard for wcsrtombs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] パラメータ

dst -
マルチバイト文字が格納される狭い文字配列へのポインタ
Original:
pointer to narrow character array where the multibyte character will be stored
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
src -
変換するNULLで終わるワイド文字列の最初の要素へのポインタ
Original:
pointer to the first element of a null-terminated wide string to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
len -
dstが指す配列内の使用可能なバイト数
Original:
number of byte available in the array pointed to by dst
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

成功した場合、最初の要素が'\0'によって指された文字配列に書き込まれたバイト数を(任意のシフトシーケンスを含むが、終端dstを除く)を返します。.
Original:
On success, returns the number of bytes (including any shift sequences, but excluding the terminating '\0') written to the character array whose first element is pointed to by dst.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
変換エラー(不正なワイド文字が検出された場合)に、(size_t)-1返し.
Original:
On conversion error (if invalid wide character was encountered), returns (size_t)-1.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

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

ナローマルチバイト文字列、所定の状態にワイド文字列に変換します
Original:
converts a wide string to narrow multibyte character string, given state
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(機能) [edit]
ワイド文字列へのナローマルチバイト文字列に変換します
Original:
converts a narrow multibyte character string to wide string
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 wcstombs