#include
using namespace std;
int my_strcmp(const char *string1, const char *string2 )
{
int ret;
while((ret=*(unsigned char *)string1-*(unsigned char *)string2++)==0 && *string1++);
return ret;
}
int main()
{
char a[] = "abch";
char b[] = "abcha";
cout << my_strcmp(a,b);
return 0;
}
阅读(3238) | 评论(0) | 转发(0) |