Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

wcscoll - Compare two wide character strings according to LC_COLLATE

&pagelevel(4)&pagelevel

Definition  

#include <wchar.h>

int wcscoll(const wchar_t *ws1, const wchar_t *ws2);

wcscoll lexically compares two wide character strings ws1 and ws2 in accordance with the collation sequence defined for the locale in LC_COLLATE.

Return val.

< 0

= 0

> 0

ws1 is less than ws2 according to the defined collation sequence.

ws1 and ws2 are equal according to the defined collation sequence.

ws1 is greater than ws2 according to the defined collation sequence

If one of the two wide character strings cannot be converted into a multibyte string, wcscoll will fail, and errno is set to EINVAL.

Notes

This version of the C runtime system only supports one-byte characters as wide character codes.

Because there is no default value defined for if an error occurs, it is advisable to set errno to 0, then call wcscoll and after the call check errno. If errno is not 0, assume that an error has occurred.
For sorting long lists, the wcsxfrm and wcscmp functions should be used.

See also

strcoll, wcsncmp, wcsxfrm