我试图在我的代码中使用字符串向量而不是字符串数组,但显然我错过了向量声明中的一些细节.使用以下代码,我收到此错误:‘vector’ was not declared in this scope
// Try to implement a vector of string elements
#include<iostream>
using namespace std;
int main() {
const int MAX_ITEMS = 10;
vector<string> my_vector(MAX_ITEMS);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我该如何正确地声明向量?
| 归档时间: |
|
| 查看次数: |
16987 次 |
| 最近记录: |