Answers for "strcmp include"

C++
1

strcmp

#include <stdio.h>
#include <string.h>
int main()
{
     char s1[20] = "BeginnersBook";
     char s2[20] = "BeginnersBook.COM";
     if (strcmp(s1, s2) ==0)
     {
        printf("string 1 and string 2 are equal");
     }else
      {
         printf("string 1 and 2 are different");
      }
     return 0;
}
Posted by: Guest on December-29-2021
5

strcmp

return
	>0 if first string is large
    <0 if first string is short
     0 if strings are equal
    
int strcmp ( const char * str1, const char * str2 );
Posted by: Guest on May-27-2021

Browse Popular Code Answers by Language