+ 1
Strcmp of "abc" and "abd" will be 0, right?
5 Antworten
+ 5
The strcmp method will perform string comparison based on the given strings and returns any of the following three values:
It will return -1 if str1 is less than the data inside str2
Returns +1, if str1 is greater than data inside the str2
and, it will return 0, if str1 and str2 are equal
+ 2
How bout you try it? I got -1
+ 1
+ 1
ཞıɬıƙą ɱıʂɧཞą it's not about data actually, it's about the Difference in ascii characters in both strings :)
https://code.sololearn.com/cN3Aabe8EsH1/?ref=app
see its returning 4 and -4 respectively
0
https://code.sololearn.com/clqhLnsR7RJD/?ref=app
yeah, it's true Netha_r2071, it's the difference in ASCII characters.