Originally Posted by
VOX
What it does is compare string1 and string2. If they match, it sticks the value 1 into result, if they don't match, it sticks a 0 into result. You need string.h for this to work and anything pretty much that starts with a str.
bzzzzzzzzzzat!
Code:
int strcmp(const char *s1, const char *s2);
The strcmp() and strncmp() functions return an integer
less than, equal to, or greater than zero if s1 (or the
first n bytes thereof) is found, respectively, to be less
than, to match, or be greater than s2.
So if they match it returns 0, not 1. And it doesn't ever have to return 1 at all. Any integer would be a valid return value, depending on the strings you pass to the function.