【发布时间】:2021-12-03 07:49:01
【问题描述】:
我尝试在线搜索,但没有找到任何信息。 vector adj[x] 是一种二维向量初始化吗?
vector <vector<int>> test(2);
vector <int> adj[2];
他们的gdb细节也不同。
(gdb) p test
$2 = std::vector of length 2, capacity 2 = {std::vector of length 0, capacity 0, std::vector of length 0, capacity 0}
(gdb) p adj
$3 = {std::vector of length 0, capacity 0, std::vector of length 0, capacity 0}
【问题讨论】:
-
它创建了一个由两个向量组成的数组。