wcstombs_s

函式功能:將字元串從wchar_t*轉換成char*,即從unicode字元轉換成多位元組字元。

函式原型:errno_t wcstombs_s( size_t *pReturnValue, char *mbstr, size_t sizeInBytes, const wchar_t *wcstr, size_t count );

頭檔案:
<stdlib.h>
參數說明:
pReturnValue: The number of characters converted. ----- 轉換後的多位元組字元串的字元數;
mbstr: The address of a buffer for the resulting converted multibyte character string. ----- char類型的字元或字元串的地址 (接收轉換後的字元串的緩衝區);
sizeInBytes: The size in bytes of the mbstr buffer. ----- 用來接收轉換後字元char類型緩衝區的大小(以位元組記);
wcstr: Points to the wide character string to be converted. ----- wchar_t類型的字元串的地址(需要轉換的字元串的緩衝區的地址);
count: The maximum number of bytes to be stored in the mbstr buffer ----- 最多可以存入mbstr的位元組數。
返回值:
Zero if successful, an error code on failure.
成功返回0, 失敗則返回失敗代碼
error code:
#define EINVAL 22
#define ERANGE 34
#define EILSEQ 42
#define STRUNCATE 80

相關詞條

熱門詞條

聯絡我們