strcoll Function

  • It compares the *str1 to *str2 in accordance with the locale specified using the setlocale() function .
  • It returns an integer that is interpreted as follows:

  • <0 for str1 is less than str2.
    0 for str1 is equal to str2.
    >0 for str1 is greater than str2.

    Syntax:

      int strcoll(const char *str1, const char *str2);

    Example:

    
    
    
    #include <stdio.h>
    
    #include <string.h>
    
    
    
    int main()
    
    {
    
    
    
        if(strcoll("hi", "hi")) 
    
        {
    
           printf("Equal");
    
        }
    
    return 0;
    
    }
    Back