A pointer to a wide-character string, where each element is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets.
A pointer to a wide-character string, where each element is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets.
1st Parameter
Pointer to the wide-character array to be filled.
2nd Parameter Type : wchar_t
A data type used to represent wide characters, typically supporting larger character sets such as Unicode. Its size is platform-dependent but is often 2 or 4 bytes.
2nd Parameter
The wide character to be set in each element of the array.
3rd Parameter Type : size_t
Platform-specific unsigned type for array indices and memory sizes.
3rd Parameter
The number of elements in the array to set to `wc`.
Read more about parameters of wmemset in parameters section
The wmemsetfunction in C language Fills 'n' wide characters of a wide character array with a specified wide character.
wmemset copies the value of c (converted to a wchar_t) into each of the first n wide characters of the object pointed to by s. This function operates on raw memory and doesn't stop at null terminators.
The wmemsetfunction takes 3
parameters:
•
wchar_t * `ptr`: Pointer to the wide-character array to be filled.
•
wchar_t `wc`: The wide character to be set in each element of the array.
•
size_t `n`: The number of elements in the array to set to `wc`.
Fills the first `n` elements of the wide-character array pointed to by `ptr` with the wide character `wc`. Returns a pointer to `ptr`.
The wmemset function return value :
Returns the value of s
Output
This example demonstrates the basic usage of wmemset to fill a wide character array with a specific character.