How to print out the contents of a vector?

后端 未结 19 1194
旧时难觅i
旧时难觅i 2020-11-22 03:46

I want to print out the contents of a vector in C++, here is what I have:

#include 
#include 
#include 
#include         


        
19条回答
  •  花落未央
    2020-11-22 04:21

    This worked for me:

        for (auto& i : name)
        {
        int r = 0;
        for (int j = 0; j < name[r].size();j++) 
        {
        std::cout << i[j];
        }
        r++;
        std::cout << std::endl;
        }
    

提交回复
热议问题