读书人

小弟我想知道strcmp的函数原代码多谢

发布时间: 2012-02-15 12:09:44 作者: rapoo

我想知道strcmp的函数原代码,谢谢!!!!
strcmp函数代码

[解决办法]
page
;***
;strcmp - compare two strings, returning less than, equal to, or greater than
;
;Purpose:
; Compares two string, determining their lexical order. Unsigned
; comparison is used.
;
; Algorithm:
; int strcmp ( src , dst )
; 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 );
; }
;
;Entry:
; const char * src - string for left-hand side of comparison
; const char * dst - string for right-hand side of comparison
;
;Exit:
; AX < 0, 0, or > 0, indicating whether the first string is
; Less than, Equal to, or Greater than the second string.
[解决办法]
汗......

读书人网 >C++

热点推荐