名前空間
変種
操作

mbstowcs

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

Defined in header <stdlib.h>
size_t mbstowcs( wchar_t* dst, const char* src, size_t len)
最初の要素は、そのワイド文字表現にsrcによって指された配列からマルチバイト文字列に変換します。変換された文字はdstが指す配列の連続する要素に格納されています。 lenワイド文字は、コピー先の配列に書き込まれるよりもより多くの.
Original:
Converts a multibyte character string from the array whose first element is pointed to by src to its wide character representation. Converted characters are stored in the successive elements of the 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.
各文字は、mbtowcは変換状態は影響を受けないことを除いて、mbtowcへの呼び出しと同じように変換されます。次の場合、変換は終了します
Original:
Each character is converted as if by a call to mbtowc, except that the mbtowc 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.
  • マルチバイトのnull文字は変換されて格納されていた.
    Original:
    The multibyte 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.
  • 無効(現在のCロケールで)マルチバイト文字が検出されました.
    Original:
    An invalid (in the current C locale) multibyte character was encountered.
    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 wide 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つのスレッドで同時に呼び出すことはできません、mbsrtowcsは、そのような場合に使用されるべき.
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, mbsrtowcs 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に書き込まれるワイド文字の数を返します。同様の現象がmbsrtowcsするための標準規格です.
Original:
POSIX specifies a common extension: if dst is a null pointer, this function returns the number of wide characters that would be written to dst, if converted. Similar behavior is standard for mbsrtowcs.
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 wide string 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 multibyte 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 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.

[編集] 値を返します

成功した場合、コピー先の配列に書き込ま終了L'\0'除く、ワイド文字の数を返します。.
Original:
On success, returns the number of wide characters, excluding the terminating L'\0', 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.
変換エラー(無効なマルチバイト文字が検出された場合)に、返品(size_t)-1.
Original:
On conversion error (if invalid multibyte 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 narrow multibyte character string to wide 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 wide string to narrow multibyte character 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 mbstowcs