質問編集履歴
3
Cのタグを外しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
dataCnt; ➡ dataCnt = cnt;
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,7 +98,7 @@
|
|
98
98
|
|
99
99
|
hoge(int cnt) {
|
100
100
|
|
101
|
-
dataCnt;
|
101
|
+
dataCnt = cnt;
|
102
102
|
|
103
103
|
data = (int**)malloc(sizeof(int*)*cnt);
|
104
104
|
|
1
ソースコードにミスがありましたので、修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
dataCnt = cnt;
|
26
26
|
|
27
|
-
data = (int**)malloc(sizeof(int)*cnt);
|
27
|
+
data = (int**)malloc(sizeof(int*)*cnt);
|
28
28
|
|
29
29
|
for(int i = 0;i < cnt;i++){
|
30
30
|
|
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
~hoge() {
|
38
38
|
|
39
|
-
for(int i = 0;i <
|
39
|
+
for(int i = 0;i < dataCnt;i++){
|
40
40
|
|
41
41
|
free(data[i]);
|
42
42
|
|
@@ -100,7 +100,7 @@
|
|
100
100
|
|
101
101
|
dataCnt;
|
102
102
|
|
103
|
-
data = (int**)malloc(sizeof(int)*cnt);
|
103
|
+
data = (int**)malloc(sizeof(int*)*cnt);
|
104
104
|
|
105
105
|
for(int i = 0;i < cnt;i++){
|
106
106
|
|