+ 1

Strcmp of "abc" and "abd" will be 0, right?

30th Aug 2020, 7:33 AM
Aayu
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
30th Aug 2020, 7:54 AM
šŸ’«AsšŸ’«
šŸ’«AsšŸ’« - avatar
+ 2
How bout you try it? I got -1
30th Aug 2020, 7:39 AM
Slick
Slick - avatar
30th Aug 2020, 7:39 AM
RuntimeERROR
RuntimeERROR - avatar
+ 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
30th Aug 2020, 7:56 AM
RuntimeERROR
RuntimeERROR - avatar
0
https://code.sololearn.com/clqhLnsR7RJD/?ref=app yeah, it's true Netha_r2071, it's the difference in ASCII characters.
30th Aug 2020, 8:17 AM
Aayu