One problem -- this only compares the first character of the strings. Remove the == check in the loop, because if the strings are equal at that character, the loop must advance to the next char.
Your crash is because your third printf() is wring -- eliminate the *'s on the strings, that won't work right.
Here's a modified myStrcmp that will correctly compare strings. The checks after the loop are to make sure that things like "stringA" < "stringAbutlonger" work properly (the shorter string is < the longer).
Code:
int myStrcmp(const char *s1, const char *s2){
for (;*s1 != '\0' && *s2 != '\0';s1++,s2++){
if (*s1 < *s2)
return -1;
if (*s1 > *s2)
return 1;
}
if (*s2 != '\0') // this means s2 is longer than s1
return -1; // -1 because s1 < s2
else if (*s1 != '\0') // s1 is longer
return 1;
else return 0;
}