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 null-terminated wide-character string to be compared.
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 null-terminated wide-character string to be compared.
Read more about parameters of wcscmp in parameters section
The wcscmpfunction in C language Compares two wide character strings lexicographically.
wcscmp compares the wide character string pointed to by s1 to the wide character string pointed to by s2. The comparison is done lexicographically. The function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached.
The wcscmpfunction takes 2
parameters:
•
const wchar_t * `ws1`: Pointer to the first null-terminated wide-character string to be compared.
•
const wchar_t * `ws2`: Pointer to the second null-terminated wide-character string to be compared.
Compares the wide-character strings `ws1` and `ws2` lexicographically. Returns an integer less than, equal to, or greater than zero if `ws1` is found to be less than, equal to, or greater than `ws2`, respectively. The comparison is based on the values of the wide characters interpreted as `wchar_t`.
The wcscmp function return value :
Returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2
Output
This example demonstrates the basic usage of wcscmp to compare two wide character strings lexicographically.