質問編集履歴
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
printf("Input num : ");
|
82
82
|
|
83
|
-
return scanf("%d%d", &*pdata1, &*pdata2);
|
83
|
+
return scanf("%d%d", &*pdata1, &*pdata2);
|
84
84
|
|
85
85
|
|
86
86
|
|
1
*pdata1 = *pdata2 と scanf("%d%d", &*pdata1, &*pdata2);に変更しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,11 +66,11 @@
|
|
66
66
|
|
67
67
|
int tmp;
|
68
68
|
|
69
|
-
tmp = *data1;
|
69
|
+
tmp = *pdata1;
|
70
70
|
|
71
|
-
data1 = data2;
|
71
|
+
*pdata1 = *pdata2;
|
72
72
|
|
73
|
-
*data2 = tmp;
|
73
|
+
*pdata2 = tmp;
|
74
74
|
|
75
75
|
|
76
76
|
|
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
printf("Input num : ");
|
82
82
|
|
83
|
-
return scanf("%d", &*pd);
|
83
|
+
return scanf("%d%d", &*pdata1, &*pdata2);---
|
84
84
|
|
85
85
|
|
86
86
|
|
@@ -95,3 +95,39 @@
|
|
95
95
|
|
96
96
|
|
97
97
|
```
|
98
|
+
|
99
|
+
エラー内容
|
100
|
+
|
101
|
+
swpint.c:In function 'swap_int':
|
102
|
+
|
103
|
+
swapint.c:48:10: warning:'return'with a value.in function returning void
|
104
|
+
|
105
|
+
return scanf("%d%d", &*pdata1, &*pdata2);
|
106
|
+
|
107
|
+
swapint.c38:6note: declared here
|
108
|
+
|
109
|
+
void swap int(int *pdata, int *pdata2)
|
110
|
+
|
111
|
+
がエラーメッセージです
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
実行イメージは
|
116
|
+
|
117
|
+
input num :10
|
118
|
+
|
119
|
+
input num :20
|
120
|
+
|
121
|
+
**交換前**
|
122
|
+
|
123
|
+
data1 = 10
|
124
|
+
|
125
|
+
data2 = 20
|
126
|
+
|
127
|
+
**交換後**
|
128
|
+
|
129
|
+
data1 = 20
|
130
|
+
|
131
|
+
data2 = 10
|
132
|
+
|
133
|
+
実行できた時の実行イメージです
|