int strcmp (const char *str1, const char *str2); int strncmp (const char *str1, const char *str2, size_t num); Compares up to num characters of the C string str1 to those of the C string str2. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ, until a terminating null-character is reached, or until num characters match in both strings, whichever happens first. str1 C string to be compared. str2 C string to be compared. num Maximum number of characters to compare. strcmp(string1,string2)比較兩個string, strncmp(string1,string2,n)則只比較前n個字元 若是string1string2則傳回值>0,
文章標籤
全站熱搜
創作者介紹
創作者 BB 的頭像
BB

Welkin小窩

BB 發表在 痞客邦 留言(0) 人氣(399)