Format
#include <wchar.h> wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
Language Level: ANSI 93
wmemset copies the value of c into each of the first n
wide characters of the object pointed to by s.
If n has the value 0, wmemset copies 0 wide characters.
Return Value
wmemset returns the value of s.
Example
This example sets the first 6 wide characters to the wide
character 'A'.
#include <wchar.h> #include <stdio.h>
void main()
{
wchar_t *in = L"1234ABCD";
wchar_t *ptr;
printf("\nEXPECTED: AAAAAACD");
ptr = wmemset(in, L'A', 6);
if (ptr == in)
printf("\nResults returned - %ls \n", ptr);
else
{
printf("\n** ERROR ** wrong pointer returned\n");
}
}
![]()
memset -- Set Bytes to Value
strnset - strset -- Set Characters in
String
wmemchr -- Locate Wide Character in
Wide-Character String
wmemcpy -- Copy Wide-Character Strings
wmemcmp -- Compare Wide-Character Strings
wmemmove -- Copy Wide-Character Strings
<wchar.h>