C++ vector > reserve size at beginning

后端 未结 4 1529
轮回少年
轮回少年 2021-01-23 21:52

in c++ I have

vector > table;

How can I resize vector so that it has 3 rows and 4 columns, all zeros?

Someth

4条回答
  •  失恋的感觉
    2021-01-23 22:32

    vector > table(3, vector(4,0));
    

    This creates a vector with 3 rows and 4 columns all initialized to 0

提交回复
热议问题