回答編集履歴
2
assert使わない
test
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
こういう感じですかね。
|
2
2
|
|
3
3
|
```C
|
4
|
-
|
5
|
-
#include <assert.h>
|
6
4
|
|
7
5
|
#include <stdio.h>
|
8
6
|
|
@@ -26,7 +24,13 @@
|
|
26
24
|
|
27
25
|
|
28
26
|
|
29
|
-
|
27
|
+
if (array == NULL || base_array == NULL) {
|
28
|
+
|
29
|
+
printf("error:malloc");
|
30
|
+
|
31
|
+
return 0;
|
32
|
+
|
33
|
+
}
|
30
34
|
|
31
35
|
|
32
36
|
|
@@ -71,19 +75,3 @@
|
|
71
75
|
|
72
76
|
|
73
77
|
```
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
```shell
|
78
|
-
|
79
|
-
./a.out
|
80
|
-
|
81
|
-
array[0][0] = 1
|
82
|
-
|
83
|
-
array[0][1] = 2
|
84
|
-
|
85
|
-
array[1][0] = 3
|
86
|
-
|
87
|
-
array[1][1] = 4
|
88
|
-
|
89
|
-
```
|
1
実行結果追加
test
CHANGED
@@ -71,3 +71,19 @@
|
|
71
71
|
|
72
72
|
|
73
73
|
```
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```shell
|
78
|
+
|
79
|
+
./a.out
|
80
|
+
|
81
|
+
array[0][0] = 1
|
82
|
+
|
83
|
+
array[0][1] = 2
|
84
|
+
|
85
|
+
array[1][0] = 3
|
86
|
+
|
87
|
+
array[1][1] = 4
|
88
|
+
|
89
|
+
```
|