The wmemset() function is a builtin function in C/C++ which copies a single wide character for a specified number of time to a wide character array. It is defined within the cwchar header file in C++.
wmemset(des, ch, count)
Parameters: The function accepts three parameters which are described below.
- des: It specifies to the wide character array to copy the wide character.
- ch: It specifies to the wide character to copy.
- count: It specifies to number of times to copy.
Return Value: The function returns three values as follows:
- If the count is greater then 0, then function returns des.
- If count is less than 0, Segmentation Fault may occur.
- If count is equal to zero, the function does nothing.
Below programs illustrate the above function.
After copying G 10 times GGGGGGGGGG
After copying r 0 times
Runtime Errors: Segmentation Fault (SIGSEGV)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference Between malloc() and calloc() with Examples
- Understanding "volatile" qualifier in C | Set 2 (Examples)
- Pointers in C/C++ with Examples
- strtok() and strtok_r() functions in C with examples
- memset() in C with examples
- std::mismatch() with examples in C++
- wcscpy() function in C++ with Examples
- wcscmp() function in C++ with Examples
- set_symmetric_difference in C++ with Examples
- ratio_equal() in C++ with examples
- std::equal_to in C++ with Examples
- quick_exit() function in C++ with Examples
- feclearexcept in C++ with Examples
- Understanding Lvalues, PRvalues and Xvalues in C/C++ with Examples
- multiset lower_bound() in C++ STL with Examples
- multiset max_size() in C++ STL with Examples
- forward_list max_size() in C++ STL with Examples
- Logical Not ! operator in C with Examples
- std::allocator() in C++ with Examples
- array data() in C++ STL with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.