Example: memcmp

The following example uses memcmp to compare two strings and checks if they are equal.

     char* s1 = "access to shared transmission";
     char* s2 = "access to transmission";
     int rc;
     rc = memcmp( s1, s2, strlen(s1));
     if (rc > 0)
          lr_output_message("`%s' is greater than '%s'", s1, s2);
     else if (rc < 0)
          lr_output_message("`%s' is less than '%s'", s1, s2);
     else
          lr_output_message("'%s' is the same as '%s'\n", s1, s2);

Output:

'access to shared transmission' is less than 'access to transmission'