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)
- Pi(π) in C++ with Examples
- cin get() in C++ with Examples
- std::less in C++ with Examples
- C/C++ while loop with Examples
- ratio_not_equal() in C++ with examples
- std::greater in C++ with Examples
- C/C++ if else statement with Examples
- scanf("%[^\n]s", str) Vs gets(str) in C with Examples
- C/C++ if else if ladder with Examples
- C/C++ do while loop with Examples
- C/C++ if statement with Examples
- std::allocator() in C++ with Examples
- ios bad() function in C++ with Examples
- SDL library in C/C++ with examples
- std::bit_or in C++ with Examples