how to create vector of given size and initialized in c++ code example
Example 1: c++ initialize size of 3d vector
vector<vector<vector<double>>> f(3, vector<vector<double>>(4, vector<double>(5)));
Example 2: declare vector of size n in c++
#include <vector>
auto n = 20
// create a vector with n=20 integer elements
std::vector<int> arr(n);