int strcoll(const char *s1, const char *s2);
The strcoll str function
is identical to the strcmp
function, except that its comparison is locale dependent
. See setlocale(3)
For those of you that are too lazy to look at strcmp, strcoll returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. And, being strcoll, it does this based on the locale.
This is another one of those fancifications
you get to use if you want to write really good code
. It's good that it's there, and available, and part of the system libraries
, but I'm afraid that it will never be used as much as it should.
From the man page:
In the "POSIX" or "C" locales strcoll() is equivalent to