strcmp(3) MudOS v21c2 (5 Sep
1994)
名稱:
strcmp() - 判斷兩個字串間的語句關係 (lexical relationship).
語法:
int strcmp( string one, string two );
整數 strcmp( 字串 one, 字串 two );
用法:
此數的 strcmp() 與 C 函式庫的 strcmp 相同. 如果字串 one 語句上在 two
之前 (即 one 在英文字典中的順序在 two 之前), 則 strcmp() 傳回比 0 小的值.
如果兩個字串相同, 則傳回 0. 如果 two 語句順序在 one 之前, 則 strcmp() 傳回比
0 大的值. 這個外部函式 (efun) 在使用 sort_array(3) 排序時, 特別有用.
參考:
翻譯:
Spock @ FF 97.Jul.23. (printed 3/16/95)
回到上一頁