您的位置:首页 > 其它

vector<vector<string>> 二维向量遍历输出

2014-01-22 16:35 369 查看
在编程中经常使用二维向量组成的数组,有时候就需要遍历输出,想了下面的方式,可以得到遍历结果

vector<string> temp_vect;

    for (vector<vector<string>>::iterator ite = vect.begin(); ite != vect.end(); ite++)

    {

            temp_vect = *ite;

            for (vector<string>::iterator itee = temp_vect.begin(); itee != temp_vect.end(); itee++)

             cout << *itee;

               cout << endl;

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: