- C strcmp () - GeeksforGeeks
Explanation: In this code, strcmp is used to compare two strings, s1 and s2 Since both strings are identical ("g f g"), strcmp returns 0, indicating the strings are equal
- What does strcmp() exactly return in C? - Stack Overflow
If it returns 0 it means that the two strings are equal, if it returns a value minor than 0 it indicates that str1 is less than str2 If it returns a value > 0 it means that str2 is less than str1
- strcmp() Function in C
Explanation: In this code, we have initialized str1 with “PrepBytes” and str2 with “ZrepBytes” Since str1 is lexicographically smaller, the strcmp Function in C must return a negative value as an answer
|