Tutorialspoint

strcoll() in C language

#include <stdio.h>
#include <string.h>
int main () {
   const char s1[] = "Helloworld";
   const char s2[] = "Blank";
   char *result;
   result = strcoll(s1, s2);
   
   if(result > 0)
      printf("String s1 is greater than string s2");
   else if(result < 0)
      printf("String s1 is less than string s2");
   else
      printf(" Strings are not same");
   return(0);
}

Advertisements
Loading...