質問編集履歴

3

コードの種類を書いた

2018/06/03 13:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -228,7 +228,7 @@
228
228
 
229
229
 
230
230
 
231
- ```
231
+ ```c++
232
232
 
233
233
  #include <string.h>
234
234
 

2

説明の追加

2018/06/03 13:38

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -221,3 +221,77 @@
221
221
  },
222
222
 
223
223
  ```
224
+
225
+
226
+
227
+ # 実行例
228
+
229
+
230
+
231
+ ```
232
+
233
+ #include <string.h>
234
+
235
+ #include <cstdio>
236
+
237
+ #include <climits>
238
+
239
+ #include <cstdlib>
240
+
241
+ #include <cmath>
242
+
243
+ #include <iostream>
244
+
245
+ #include <string>
246
+
247
+ #include <vector>
248
+
249
+ #include <map>
250
+
251
+ #include <set>
252
+
253
+ #include <bitset>
254
+
255
+ #include <list>
256
+
257
+ #include <stack>
258
+
259
+ #include <queue>
260
+
261
+ #include <algorithm>
262
+
263
+ #include <numeric>
264
+
265
+ #include <sstream>
266
+
267
+ #define rep(i, n) for(int i = 0; i < (int)(n); i++)
268
+
269
+ using namespace std;
270
+
271
+
272
+
273
+ int main(){
274
+
275
+ printf("hoge");
276
+
277
+ int x;
278
+
279
+ cin >> x;
280
+
281
+ vector<int> vc;
282
+
283
+ vc.push_back(x);
284
+
285
+ cout << vc[0] << endl;
286
+
287
+ return 0;
288
+
289
+ }
290
+
291
+ ```
292
+
293
+
294
+
295
+ このように書くとコンパイルは通るんですよね
296
+
297
+ しかし実行するとhogeもでず、何も出力されず実行が終わります。

1

説明の追加

2018/06/03 13:37

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -181,3 +181,43 @@
181
181
  とかうつと補間でvectorが表示されます
182
182
 
183
183
  その詳細を見るとFile: stl_vector.hとかになっています
184
+
185
+
186
+
187
+ # 追記
188
+
189
+
190
+
191
+ 一度c_cpp_properties.jsonを消して緑波線の電球マークを押し、新しく作成し
192
+
193
+ includePathの部分に同じパスをコピペすると
194
+
195
+ 一番上の`#include <string.h>`だけに赤線が引かれ
196
+
197
+ `'string.h' file not found`
198
+
199
+ とエラーが出ます
200
+
201
+ そのincludeの部分をコメントあるとすると次の`#include <cstdio>`
202
+
203
+ に赤線が引かれ、結果的にすべておこられてしまいます
204
+
205
+
206
+
207
+ browseの項目にもpathがありますがこれはどういう項目なんでしょうか
208
+
209
+ ```
210
+
211
+ "browse": {
212
+
213
+ "path": [
214
+
215
+ "${workspaceFolder}"
216
+
217
+ ],
218
+
219
+ "limitSymbolsToIncludedHeaders": true
220
+
221
+ },
222
+
223
+ ```