wcscoll - C wchar.h

C examples for wchar.h:wcscoll

Type

function

From


<cwchar>
<wchar.h>

Description

Compare two wide strings using locale

Prototype

int wcscoll (const wchar_t* wcs1, const wchar_t* wcs2);

Parameters

Parameter Description
wcs1 C wide string to be compared.
wcs2 C wide string to be compared.

Return Value

Value Meaning
0 equal
>0 wcs1 is greater than wcs2
<0 wcs1 is less than wcs2

Demo Code


#include <stdio.h>
#include <string.h>

int main()/*from   w w  w  . ja  v  a  2 s  .  c  o m*/
{
  wchar_t wcs[][5] = { L"123" , L"qqq" , L"Rest" };
  int n;
  for (n = 0; n<3; n++)
    if (wcscoll(wcs[n], L"qq") == 0)
    {
      wprintf(L"found %ls\n", wcs[n]);
    }
  return 0;
}

Related Tutorials