共用方式為


wstring_convert::to_bytes

轉換寬字串轉換成位元組字串。

byte_string to_bytes(_Elem _Char);
byte_string to_bytes(const _Elem* _Wptr);
byte_string to_bytes(const wide_string& _Wstr);
byte_string to_bytes(const _Elem* _First, const _Elem* _Last);

參數

參數

描述

_Char

要轉換的寬字元。

_Wptr

C-Style, null 結尾字元序列開始, wptr,會轉換成。

_Wstr

要轉換的 wide_string

_First

在要轉換的元素範圍內的第一個項目。

_Last

在要轉換的元素範圍內的最後一個項目。

備註

如果 轉換狀態。 物件是 not 建構以明確的值,則會設定為其預設值 (初始轉換狀態),在轉換之前。 否則會保持不變。

輸入項目數目成功轉換的在轉換計算物件中。 如果轉換未發生任何錯誤,成員函式會傳回已轉換的位元組字串。 則為,否則為,表示物件建構時位元組字串錯誤訊息的初始設定式,成員函式會傳回位元組字串錯誤訊息物件。 否則,成員函式擲回類別 range_error物件。

需求

標題: <cvt/wstring>

命名空間: stdext::cvt

請參閱

參考

wstring_convert Class