PROWAREtech
C/C++: strcmp Procedure
Compare two ASCII c-strings.
int strcmp ( unsigned char *src, unsigned char *dst )
{
int ret = 0;
while( ! (ret = *src - *dst) && *dst)
++src, ++dst;
if ( ret < 0 )
ret = -1;
else if ( ret > 0 )
ret = 1;
return ret;
}
Comment