Home > Back-end >  It's not just the normal solution? Why always partly right. To find for a long time don't
It's not just the normal solution? Why always partly right. To find for a long time don't

Time:05-01

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:

reference 2 building self-confidence boy reply:
STRCMP not compare the size of address values, but compare the size of address in data ~

Brother, thanks, always thought the array and pointer is a thing
  • Related