Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
211 views
in Technique[技术] by (71.8m points)

Accessing a row in a vector of vectors in C++

I have created a matrix of integers using vector of vectors. I need to print a particular row of the matrix. Is there a way to do it?

for (int j = 0; j < 100; j++)
{
    for (size_t i = 0; i < numberOfDataBits; ++i)
    {
        inputDataBits[i] = distribution(generator) % 2;       //generates input data stream
        count++;

    }


    big.push_back(inputDataBits);
    for (const std::vector<int>& v : big)
    {
        for (int x : v) std::cout << x << ' ';
        std::cout << std::endl;
    } 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...