Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ vector resize

std::vector<int> vec = {1, 2, 3};
vec.resize(2); // {1, 2}
vec.resize(4); // {1, 2, 0, 0,}
vec.resize(6, 9);  // {1, 2, 0, 0, 9, 9}
 
PREVIOUS NEXT
Tagged: #vector #resize
ADD COMMENT
Topic
Name
2+9 =