Trying to create a 3 dimensional vector in c++

后端 未结 2 1238
暖寄归人
暖寄归人 2020-12-30 06:00

So, im trying to create a 3 dimensional 5x3x2 vector, using the vector lib and saving the number 4 in every node.

Thats what im trying:

vector

        
2条回答
  •  一整个雨季
    2020-12-30 06:18

    You almost got it right -- the second nested vector should be vector >, not just a vector:

    vector > > vec (5,vector >(3,vector (2,4)));
    

提交回复
热议问题