What different behavior have you observed?
If it is about the return value, then the actual value returned is compiler specific. Standards only mandate to return value = 0, < 0 or > 0, so while some compiler may return 0, -1, 1 others may return the actual value(no of chars) by which one string is smaller or larger than other.
If the issue is something else, kindly elobrate.
As ~ swim ~ has already stated the specification does not mandate what is returned beyond 0, <0 or >0. Some will return 0, -1, 1 and others may return the character number (position) or ascii value (negated if necessary). All that you can be certain of is that if the return value !=0 then the strings do not match. See...
Note that strcmp is a C function, so you need to #include <cstring>. If you want to do things the C++ way then use the string class and use the string::compare function. See...