#C 语言标准库函数 wmemset
#include <wchar.h>
wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
说明
把数组前 n 个元素赋为同一 wchar_t 值。
以元素为单位执行赋值,因此也可以填入宽字符值较大的字符。接口不会自动追加终止符。
自 C95 起提供。
参数
s- 可写宽字符数组。c- 填入每个元素的宽字符值。n- 要写入的元素数。
返回值
- 返回 s。
#示例
#include <wchar.h>
int main(void)
{
wchar_t text[4] = {0};
return wmemset(text, L'A', 3) != text || text[2] != L'A';
}
#相关接口
- 接口变体 memset