Compares two wide-character strings. It returns an integer that
indicates if the strings are different, and how they differ.
Format
#include <wchar.h>
int wcscmp (const wchar_t *wstr_1, const wchar_t
*wstr_2);
Arguments
- wstr_1, wstr_2
- Pointers to null-terminated wide-character strings.
Description
This function compares the wide characters in wstr_
1 with those in wstr_2. If the characters differ,
the function returns:
- An integer less than 0, if the codepoint of the first
differing character in wstr_1 is less than the codepoint
of the corresponding character in wstr_2
- An integer greater than 0, if the codepoint of the
first differing character in wstr_1 is greater than
the codepoint of the corresponding character in wstr_2
If the wide-characters strings are identical, the function returns
zero.
Unlike the wcscoll function, the wcscmp function compares the string
based on the binary value of each wide character.
See also wcsncmp in this section.
Return Values
< 0 | Indicates that wstr_
1 is less than wstr_2. |
=
0 | Indicates that wstr_1 equals wstr_
2. |
> 0 | Indicates that
wstr_1 is greater than wstr_2. |
Previous Page | Next Page | Table of Contents | Index