teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

訂正

2018/01/28 05:28

投稿

nullpon
nullpon

スコア5739

answer CHANGED
@@ -1,4 +1,4 @@
1
- ところで、ソートは自前で実装する必要はありません。
1
+ ところで、ソートは自前で実装する必要はありません。標準ライブラリを使いましょう。
2
2
  ```bash
3
3
  #include <stdlib.h>
4
4
  #include <string.h>
@@ -23,10 +23,6 @@
23
23
  h = h->next;
24
24
  }
25
25
 
26
- if (a == array + 1) {
27
- return;
28
- }
29
-
30
26
  # 配列の各要素をソートする。
31
27
  qsort(array, sizeof(struct address *), a - array, compare_address_name);
32
28