+ 1
Strcmp of "abc" and "abd" will be 0, right?
6 Answers
+ 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.