现在的位置: 首页 > 综合 > 正文

Vector的初始化与遍历

2013年08月01日 ⁄ 综合 ⁄ 共 237字 ⁄ 字号 评论关闭
std::vector<int> IntTest;

    for (int i = 0; i < 10++i)
    {
        IntTest.push_back(i);
    }

    for (std::vector<int>::iterator iter = IntTest.begin(); iter != IntTest.end(); ++iter)
    {
        std::cout 
<< *iter << std::endl;
    }
 

抱歉!评论已关闭.