Copies the wide character ch into each of the first count wide characters of the wide character array (or integer array of compatible type) pointed to by dest.
If overflow occurs, the behavior is undefined.
If count is zero, the function does nothing.
[edit] Parameters dest - pointer to the wide character array to fill ch - fill wide character count - number of wide characters to fill [edit] Return valueReturns a copy of dest
[edit] NotesThis function is not locale-sensitive and pays no attention to the values of the wchar_t objects it writes: nulls as well as invalid wide characters are written too.
[edit] Example#include <locale.h> #include <stdio.h> #include <wchar.h> int main(void) { wchar_t ar[10] = L"1234567890"; // no trailing null in the array wmemset(ar, L'\U0001f34c', 5); // replaces [12345] with the ð bananas wmemset(ar + 5, L'è', 5); // replaces [67890] with the è bananas setlocale(LC_ALL, "en_US.utf8"); for (size_t n = 0; n < sizeof ar / sizeof *ar; ++n) putwchar(ar[n]); putwchar(L'\n'); }
Output:
ðððððèèèèè[edit] References
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4