質問編集履歴
2
エラーを載せました
test
CHANGED
File without changes
|
test
CHANGED
@@ -165,3 +165,143 @@
|
|
165
165
|
エディター、コンパイラはXcodeを使用しています。
|
166
166
|
|
167
167
|
どうか訂正のほどよろしくお願いします。
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
訂正です。
|
180
|
+
|
181
|
+
こちらがエラーになります。
|
182
|
+
|
183
|
+
よろしくお願いします。
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
gcc -Wall -o samp4.6.24.exe samp4.6.24.c
|
190
|
+
|
191
|
+
samp4.6.24.c: In function ‘main’:
|
192
|
+
|
193
|
+
samp4.6.24.c:10:2: error: stray ‘\343’ in program
|
194
|
+
|
195
|
+
int l; /*配列長*/
|
196
|
+
|
197
|
+
^
|
198
|
+
|
199
|
+
samp4.6.24.c:10:2: error: stray ‘\200’ in program
|
200
|
+
|
201
|
+
samp4.6.24.c:10:2: error: stray ‘\200’ in program
|
202
|
+
|
203
|
+
samp4.6.24.c:11:2: error: stray ‘\343’ in program
|
204
|
+
|
205
|
+
int r; /*残り文字数*/
|
206
|
+
|
207
|
+
^
|
208
|
+
|
209
|
+
samp4.6.24.c:11:2: error: stray ‘\200’ in program
|
210
|
+
|
211
|
+
samp4.6.24.c:11:2: error: stray ‘\200’ in program
|
212
|
+
|
213
|
+
samp4.6.24.c:17:2: error: stray ‘\343’ in program
|
214
|
+
|
215
|
+
for (;;) /**/
|
216
|
+
|
217
|
+
^
|
218
|
+
|
219
|
+
samp4.6.24.c:17:2: error: stray ‘\200’ in program
|
220
|
+
|
221
|
+
samp4.6.24.c:17:2: error: stray ‘\200’ in program
|
222
|
+
|
223
|
+
samp4.6.24.c:25:3: error: stray ‘\343’ in program
|
224
|
+
|
225
|
+
if (strcmp(a , c) == 0 ) { /*条件2:配列aにexitが入力されたことが真であると確認できたとき*/
|
226
|
+
|
227
|
+
^
|
228
|
+
|
229
|
+
samp4.6.24.c:25:3: error: stray ‘\200’ in program
|
230
|
+
|
231
|
+
samp4.6.24.c:25:3: error: stray ‘\200’ in program
|
232
|
+
|
233
|
+
samp4.6.24.c:32:3: error: stray ‘\343’ in program
|
234
|
+
|
235
|
+
strcat(a , b); /*配列aの後にbを連結*/
|
236
|
+
|
237
|
+
^
|
238
|
+
|
239
|
+
samp4.6.24.c:32:3: error: stray ‘\200’ in program
|
240
|
+
|
241
|
+
samp4.6.24.c:32:3: error: stray ‘\200’ in program
|
242
|
+
|
243
|
+
samp4.6.24.c:33:3: error: stray ‘\343’ in program
|
244
|
+
|
245
|
+
l = strlen(a); /*lが配列aの長さを表すことを指定*/
|
246
|
+
|
247
|
+
^
|
248
|
+
|
249
|
+
samp4.6.24.c:33:3: error: stray ‘\200’ in program
|
250
|
+
|
251
|
+
samp4.6.24.c:33:3: error: stray ‘\200’ in program
|
252
|
+
|
253
|
+
samp4.6.24.c:35:10: error: expected expression before ‘>’ token
|
254
|
+
|
255
|
+
if (l => 30) { /*条件1:文字列長が100になったとき*/
|
256
|
+
|
257
|
+
^
|
258
|
+
|
259
|
+
samp4.6.24.c:35:10: error: stray ‘\343’ in program
|
260
|
+
|
261
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
262
|
+
|
263
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
264
|
+
|
265
|
+
samp4.6.24.c:35:10: error: stray ‘\343’ in program
|
266
|
+
|
267
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
268
|
+
|
269
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
270
|
+
|
271
|
+
samp4.6.24.c:35:10: error: stray ‘\343’ in program
|
272
|
+
|
273
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
274
|
+
|
275
|
+
samp4.6.24.c:35:10: error: stray ‘\200’ in program
|
276
|
+
|
277
|
+
samp4.6.24.c:36:4: error: stray ‘\343’ in program
|
278
|
+
|
279
|
+
a[0] = '\0'; /*それまで入力された文字列をクリアする*/
|
280
|
+
|
281
|
+
^
|
282
|
+
|
283
|
+
samp4.6.24.c:36:4: error: stray ‘\200’ in program
|
284
|
+
|
285
|
+
samp4.6.24.c:36:4: error: stray ‘\200’ in program
|
286
|
+
|
287
|
+
samp4.6.24.c:47:4: error: stray ‘\343’ in program
|
288
|
+
|
289
|
+
printf("残りの文字数は %d\n", r); /*残り文字数の計算式*/
|
290
|
+
|
291
|
+
^
|
292
|
+
|
293
|
+
samp4.6.24.c:47:4: error: stray ‘\200’ in program
|
294
|
+
|
295
|
+
samp4.6.24.c:47:4: error: stray ‘\200’ in program
|
296
|
+
|
297
|
+
samp4.6.24.c:53:1: error: expected declaration or statement at end of input
|
298
|
+
|
299
|
+
}
|
300
|
+
|
301
|
+
^
|
302
|
+
|
303
|
+
samp4.6.24.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]
|
304
|
+
|
305
|
+
}
|
306
|
+
|
307
|
+
^
|
1
表示例を追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -134,6 +134,28 @@
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
+
スクリプトの表示例はこのような感じになるみたいです。
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
Enter a string: 1234ghij[Enter]
|
142
|
+
|
143
|
+
String = 1234ghij, Length = 8, Remaining = 22
|
144
|
+
|
145
|
+
Enter a string: abcdefg[Enter]
|
146
|
+
|
147
|
+
String = 1234ghijabcdefg, Length = 15, Remaining = 15
|
148
|
+
|
149
|
+
Enter a string: clear[Enter]
|
150
|
+
|
151
|
+
String cleared
|
152
|
+
|
153
|
+
Enter a string: exit[Enter]
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
137
159
|
C言語を始めたばかりで、今まで使っていた言語と少し勝手が違うと認識しながら悪戦苦闘しています。
|
138
160
|
|
139
161
|
目的の『』内の動作になれば完成です。
|