C++ STL之向量vector

发布时间 2023-09-19 22:25:11作者: 达可奈特
/*vector_example.cpp*/
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    vector<string> msg = {"Hello", "C++", "World", "from", "VSCode", "and the C++ extension!"};

    for (const string& word : msg) {
        cout << word << " ";
    }
    cout << endl;

    return 0;
}