The function 'strcmp' compares the two string arguments. It compares both the strings character by character until the NULL character. If all the characters in both the strings are same including the NULL character, it is declared as matched, and hence 0 is reported. If not, 1 is reported. In the POSIX standards, 0 means success and 1 means failure and this can be equated to TRUE of FALSE respectively.
Hope this answers your question.
-- Spoken Tutorial Team
Thanks for pointing out. I did not mention non-zero in my previous post. 1 or -1 should be read as non-zero. That means, if the match is successful, it will definitely return 0 (zero), and if the match is unsuccessful it will return something non-zero . Now, the non-zero comes from the comparison of ASCII values. In the program that you supplied above, ASCII value of 'I' for the string 'Ice' is 73, and ASCII value of 'J' for the string 'Jello' is 74. The function 'strcmp' will calculate the difference in ASCII values of 'I' and 'J', i.e. 73-74 = -1. Hence, you get -1. Try out different options and see for yourself. Hope to answer your question.
--Spoken Tutorial Team.