Answers for "how to make a vector of particular size with some values"

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

Code answers related to "how to make a vector of particular size with some values"

Browse Popular Code Answers by Language