Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
int wordCmp (struct lnode* n1, struct lnode* n2)
2 つのノードの文字列間の関係を示す整数値を返すにはどうすればよいでしょうか? ノード内の文字列を比較する方法がよくわかりません。
あなたの Inode 構造体の構造はわかりませんが、次のようになっていると考えられます。
struct Inode { char str[20]; };
次に、wordCmp 関数を次のように記述できます。
int wordCmp(struct Inode *n1, struct Inode *n2) { return strcmp(n1->str, n2->str); }
これが役立つことを願っています!