std::strcoll

From cppreference.com
Defined in header <cstring>
int strcoll( const char* lhs, const char* rhs );

Compares two null-terminated byte strings according to the current locale as defined by the LC_COLLATE category.

Contents

[edit] Parameters

lhs, rhs - pointers to the null-terminated byte strings to compare

[edit] Return value

Negative value if lhs is less than (precedes) rhs.

0 if lhs is equal to rhs.

Positive value if lhs is greater than (follows) rhs.

[edit] Notes

Collation order is typically lexicographic case-insensitive comparison according to the locale's alphabet, but in some locales, groups of characters compare as single collation units. For example, "ch" in Czech follows "h" and precedes "i", and "ng" in Welsh follows "g" and precedes "h".

[edit] Example

[edit] See also

compares two wide strings in accordance to the current locale
(function)
[virtual]
compares two strings using this facet's collation rules
(virtual protected member function of std::collate)
transform a string so that strcmp would produce the same result as strcoll
(function)