Name

wcscoll - wide-character string comparison using collating information

Library

libc.lib

Synopsis

  #include <wchar.h>
  int wcscoll (const wchar_t *s1, const wchar_t *s2);

Return values

The wcscoll function returns an integer greater than, equal to, or less than 0, if s1 is greater than, equal to, or less than s2.

No return value is reserved to indicate errors; callers should set errno to 0 before calling wcscoll. If it is non-zero upon return from wcscoll, an error has occurred.


Detailed description

The wcscoll function compares the null-terminated strings s1 and s2 according to the current locale collation order. In the "C" locale, wcscoll is equivalent to wcscmp.

Examples

#include <wchar.h>
/* Illustrates how to use wcscoll API */
int example_wcscoll (void)
{  
        /* compares the two strings */
  if( wcscoll(L"abcdef",L"abcdeg") != L’f’-L’g’)  
   return -1;
 return 0;
}

         


Errors

The wcscoll function will fail if:
[EILSEQ]
  An invalid wide character code was specified.
[ENOMEM]
  Cannot allocate enough memory for temporary buffers.

Limitations

The current implementation of wcscoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcscmp in this implementation.

See also

setlocale, strcoll, wcscmp, wcsxfrm

Bugs

The current implementation of wcscoll only works in single-byte LC_CTYPE locales, and falls back to using wcscmp in locales with extended character sets.

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top