teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

コードの種類を書いた

2018/06/03 13:38

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -113,7 +113,7 @@
113
113
 
114
114
  # 実行例
115
115
 
116
- ```
116
+ ```c++
117
117
  #include <string.h>
118
118
  #include <cstdio>
119
119
  #include <climits>

2

説明の追加

2018/06/03 13:38

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -109,4 +109,41 @@
109
109
  ],
110
110
  "limitSymbolsToIncludedHeaders": true
111
111
  },
112
- ```
112
+ ```
113
+
114
+ # 実行例
115
+
116
+ ```
117
+ #include <string.h>
118
+ #include <cstdio>
119
+ #include <climits>
120
+ #include <cstdlib>
121
+ #include <cmath>
122
+ #include <iostream>
123
+ #include <string>
124
+ #include <vector>
125
+ #include <map>
126
+ #include <set>
127
+ #include <bitset>
128
+ #include <list>
129
+ #include <stack>
130
+ #include <queue>
131
+ #include <algorithm>
132
+ #include <numeric>
133
+ #include <sstream>
134
+ #define rep(i, n) for(int i = 0; i < (int)(n); i++)
135
+ using namespace std;
136
+
137
+ int main(){
138
+ printf("hoge");
139
+ int x;
140
+ cin >> x;
141
+ vector<int> vc;
142
+ vc.push_back(x);
143
+ cout << vc[0] << endl;
144
+ return 0;
145
+ }
146
+ ```
147
+
148
+ このように書くとコンパイルは通るんですよね
149
+ しかし実行するとhogeもでず、何も出力されず実行が終わります。

1

説明の追加

2018/06/03 13:37

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -89,4 +89,24 @@
89
89
 
90
90
  しかしve
91
91
  とかうつと補間でvectorが表示されます
92
- その詳細を見るとFile: stl_vector.hとかになっています
92
+ その詳細を見るとFile: stl_vector.hとかになっています
93
+
94
+ # 追記
95
+
96
+ 一度c_cpp_properties.jsonを消して緑波線の電球マークを押し、新しく作成し
97
+ includePathの部分に同じパスをコピペすると
98
+ 一番上の`#include <string.h>`だけに赤線が引かれ
99
+ `'string.h' file not found`
100
+ とエラーが出ます
101
+ そのincludeの部分をコメントあるとすると次の`#include <cstdio>`
102
+ に赤線が引かれ、結果的にすべておこられてしまいます
103
+
104
+ browseの項目にもpathがありますがこれはどういう項目なんでしょうか
105
+ ```
106
+ "browse": {
107
+ "path": [
108
+ "${workspaceFolder}"
109
+ ],
110
+ "limitSymbolsToIncludedHeaders": true
111
+ },
112
+ ```