strcoll

Description

Compares strings using locale-specific information.

#include <string.h> Required only for function declarations  

int strcoll( const char *string1, const char *string2 );

string1 String to compare  
string2 String to compare  

Remarks

The strcoll function compares string1 and string2 in a manner determined by the LC_COLLATE macro and returns a value indicating their relationship, as follows:

Value Meaning

< 0 string1 less than string2
= 0 string1 identical to string2
> 0 string1 greater than string2

For more information on the LC_COLLATE macro, see the setlocale function.

The strcoll function operates on null-terminated strings. The string arguments to these functions are expected to contain a null character ('\0') marking the end of the string.

The strcoll function differs from strcmp in that it uses locale-specific information to provide locale-specific collating sequences.

Return Value

The return value for this function is described above.

Compatibility

Standards:ANSI

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:DOS32X

See Also

localeconv, setlocale, strcmp, strncmp, strxfrm