< cpp‎ | string‎ | wide
Defined in header <cwchar>
wchar_t* wmemset( wchar_t* dest, wchar_t ch, std::size_t count );

Copies wide character ch into each of the first count wide characters of the object pointed to by dest. If dest+size+1 points outside the object, the behavior is undefined.


[edit] Parameters

dest - pointer to the object to fill
ch - fill character
count - number of wide characters to fill

[edit] Return value


[edit] Example

#include <iostream>
#include <cwchar>
int main()
    wchar_t a[20];
    std::wmemset(a, L'\0', 20);
    std::cout << "a[0] = " << a[0] << '\n';


a[0] = 0

[edit] See also

copies a certain amount of wide characters between two non-overlapping arrays
assigns a value to a number of elements
(function template)
checks if a type is trivially copyable
(class template)
C documentation for wmemset