nt strcmp ( const char* src, const char* dst )
用法:#include <string.h>
功能:STRCMP compares two strings and returns an integer to indicate whether the first is less than the second, the two are equal, or whether the first is greater than the second.
返回结果:
returns -1 if src < dst
returns 0 if src == dst
returns +1 if src > dst
源码实现:
int strcmp ( const char* src, const char* dst )
{
int ret = 0 ;
while( ! (ret = *(unsigned char *)src - *(unsigned char *)dst) && *dst)
++src, ++dst;
if ( ret < 0 )
ret = -1 ;
else if ( ret > 0 )
ret = 1 ;
return( ret );
}