How to convert vector to array

后端 未结 10 1557
野的像风
野的像风 2020-11-22 09:20

How do I convert a std::vector to a double array[]?

10条回答
  •  北海茫月
    2020-11-22 09:35

    You can do some what like this

    vector  id;
    vector  v;
    
    if(id.size() > 0)
    {
        for(int i = 0; i < id.size(); i++)
        {
            for(int j = 0; j < id.size(); j++)
            {
                double x = v[i][j];
                cout << x << endl;
            }
        }
    }
    

提交回复
热议问题