Answers for "how to make a vector with specific size"

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 with specific size"

Browse Popular Code Answers by Language