wcsncmp

Compares a specified number of characters between two wide-character strings.

Library:LibC
Classification:ANSI
Service:Characters and Strings

Syntax

  #include <wchar.h> 
   
  int  wcsncmp (
     const wchar_t    *ws1,
     const wchar_t    *ws2,
     size_t            n);
  

Parameters

ws1

(IN) Points to the wide-character string to compare.

ws2

(IN) Points to the wide-character string to compare.

n

(IN) Specifies the number of wide characters to compare.

Return Values

Returns 0 if the two wide-character strings match. Otherwise, returns the following types of integers:

  • Less than 0 if ws1 is less than ws2.

  • Greater than 0 if ws1 is greater than ws2.

Remarks

The wcsncmp function compares not more than n characters from the string pointed to by ws1 to the string pointed to by ws2. Characters that follow a null-terminating character are not compared.

See Also

wcscmp