Originally Posted by
iMalc
The rule about length that your referring to only applies when one string is a prefix of the other.
Give one example please....
According to laserlight I checked some examples on myown.
Code:
printf("\n%d\n" , strcmp("f" , "ejh "));
Here strcmp compares f and e at first f has greater ASCII value than e .... then we have the '\0' character of the first literal so the work of strcmpy ends here?
Either or not the second literal "ejh" has more than n-1 character from the first .
what about when we have
Code:
printf("\n%d\n" , strcmp(" a" , "a "));
strcmp compares space with a then space with space then a with space ???