CodePudding user response:
int mystrcmp (const char *, a const char * b)
{
Assert (a & amp; & B);
While (* a & amp; & * b) {
If (* a & gt; * b)
return 1;
If (* a & lt; * b)
return -1;
+, b++;
}
If (* a==0 & amp; & * b==0)//0 namely '\ 0'
return 0;
If (* a=='\ 0')
return -1;
If (* b=='\ 0')
return 1;
return 0;
}
For your reference ~
CodePudding user response:
STRCMP not compare the size of address values, but compare the size of address in data ~CodePudding user response: