A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
1st Parameter
Pointer to the first wide-character array to compare.
2nd Parameter Type : const wchar_t *
A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
2nd Parameter
Pointer to the second wide-character array to compare.
3rd Parameter Type : size_t
Platform-specific unsigned type for array indices and memory sizes.
3rd Parameter
The number of elements to compare in each array.
Read more about parameters of wmemcmp in parameters section
The wmemcmpfunction in C language Compares the first 'n' wide characters of two wide character arrays.
wmemcmp compares the first n wide characters of the object pointed to by s1 to the first n wide characters of the object pointed to by s2. This function operates on raw memory and doesn't stop at null terminators.
The wmemcmpfunction takes 3
parameters:
•
const wchar_t * `ptr1`: Pointer to the first wide-character array to compare.
•
const wchar_t * `ptr2`: Pointer to the second wide-character array to compare.
•
size_t `n`: The number of elements to compare in each array.
Compares the first `n` elements of the wide-character arrays `ptr1` and `ptr2`. Returns an integer less than, equal to, or greater than zero if the first array is found to be less than, equal to, or greater than the second array.
The wmemcmp function return value :
Returns an integer less than, equal to, or greater than zero if the first n wide characters of s1 are found, respectively, to be less than, to match, or be greater than the first n wide characters of s2
Output
This example demonstrates the basic usage of wmemcmp to compare two wide character strings up to a specified length.