c++ array

array

#include <array>
#include <string>
#include <iostream>

using namespace std;

int main()
{
    array<string, 5> coll = { "test1","test2" };

    for (int k=0;k<coll.size();++k)
    {
        cout << k<<"  " << coll[k] << endl;
    }

    system("pause");
    return 0;
}

0 test1
1 test2
2
3
4

 

posted @ 2019-12-10 16:33  西北逍遥  阅读(283)  评论(0)    收藏  举报