码迷,mamicode.com
首页 > 编程语言 > 详细

c++ array

时间:2019-12-10 16:45:47      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:span   nbsp   return   main   style   namespace   end   system   col   

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

 

c++ array

标签:span   nbsp   return   main   style   namespace   end   system   col   

原文地址:https://www.cnblogs.com/herd/p/12017506.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!