名前空間
変種
操作

mbsrtowcs

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

Defined in header <wchar.h>
size_t mbsrtowcs( wchar_t* dst, const char** src, size_t len, mbstate_t* ps )
最初の要素がそのワイド文字表現に*psによって指された配列から、*srcによって記述変換状態で始まるNULLで終わるマルチバイト文字列を変換します。 dstがnullでない場合、変換された文字はdstが指すwchar_t配列の連続する要素に格納されています。 lenワイド文字は、コピー先の配列に書き込まれるよりもより多くの.
Original:
Converts a null-terminated multibyte character sequence, which begins in the conversion state described by *ps, from the array whose first element is pointed to by *src to its wide character representation. If dst is not null, converted characters are stored in the successive elements of the wchar_t array pointed to by dst. No more than len wide characters 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.
各マルチバイト文字は、mbrtowcへの呼び出しと同じように変換されます。次の場合、変換は終了します
Original:
Each multibyte character is converted as if by a call to mbrtowc. 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.
  • マルチバイトのnull文字は変換されて格納されていました。 srcに設定されているNULL*ps初期シフト状態を表します.
    Original:
    The multibyte null character was converted and stored. src is set to NULL and *ps represents the initial shift state.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 無効なマルチバイト文字(現在のCロケールに基づいて)検出されました。 srcはない最初のマルチバイト文字の先頭を指すように設定されています.
    Original:
    An invalid multibyte character (according to the current C locale) was encountered. src is set to point at the beginning of the first unconverted multibyte character.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 格納する次のワイド文字はlenを超えてしまいます。 srcはない最初のマルチバイト文字の先頭を指すように設定されています。 dst==NULL場合、この条件がチェックされていません.
    Original:
    the next wide character to be stored would exceed len. src is set to point at the beginning of the first unconverted multibyte character. This condition is not checked if dst==NULL.
    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 wide character array where the results 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 pointer to the first element of a null-terminated multibyte string
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 wide characters 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.
ps -
変換状態オブジェクトへのポインタ
Original:
pointer to the conversion state object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

成功した場合、文字配列に書き込ま終了L'\0'除く、ワイド文字の数を返します。.. dst==NULL場合は、無制限の長さが与えられて書き込まれたであろうワイド文字の数を返します。.
Original:
On success, returns the number of wide characters, excluding the terminating L'\0', written to the character array.. If dst==NULL, returns the number of wide characters that would have been written given unlimited length.
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の店舗EILSEQerrnoを返し、指定されていない状態で*psを残し.
Original:
On conversion error (if invalid multibyte character was encountered), returns (size_t)-1, stores EILSEQ in errno, and leaves *ps in unspecified state.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

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

ワイド文字、所定の状態に次のマルチバイト文字に変換します
Original:
converts the next multibyte character to wide character, 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 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]
C++ documentation for mbsrtowcs