2 ms·
Calling it (eg) strdiff instead would help here, if(!strdiff(str1,str2)) matches the intuitive interpretation.
by a1369209993 7y ago
Calling it (eg) strdiff instead would help here, if(!strdiff(str1,str2)) matches the intuitive interpretation.
- saagarjha 7y agoIt's a three way comparison, not an equality one. If you treat it like that then the return value makes more sense.
- a1369209993 7y agoSure - thats why it shouldn't be str_ne or similar. strDIFF (or rather, strcmp) returns the direction in which strings DIFFer - less than (negative), greater than (positive), or equal (zero).