int string_compare(char s1[], char s2[]) { char *s1ptr, *s2ptr; s1ptr = s1; // s1ptr punta all'elemento s1[0] s2ptr = s2; // s2ptr punta all'elemento s2[0] while (*s1ptr!= '\0' || *s2ptr!='\0') { if (*s1ptr>*s2ptr) { return -1; } else if (*s1ptr<*s2ptr) { return 1; } else { s1ptr++; s2ptr++; } } if (*s1ptr == '\0' && *s2ptr == '\0') { return 0; } if (*s1ptr == '\0') { return 1; } if (*s2ptr == '\0') { return -1; } }