Two-dimensional vector printing

后端 未结 4 1063
野性不改
野性不改 2020-12-18 11:36

I\'ve got a two-dimension string vector that I need to print out. The whole program should read a line from a txt file, store each word from it as a different element and th

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 11:42

    I would change it to the following:

    for (int i = 0; i < vec.size(); i++)
    {
        for (int j = 0; j < vec[i].size(); j++)
        {
            cout << vec[i][j];
        }
    }
    

提交回复
热议问题