Answers for "create vector of specific size c++"

C++
0

create vector of specific size c++

// create a vector with 20 integer elements
std::vector<int> arr(20);

for(int x = 0; x < 20; ++x)
   arr[x] = x;
Posted by: Guest on July-16-2021

Browse Popular Code Answers by Language