本文共 608 字,大约阅读时间需要 2 分钟。
void resize ( size_type sz, T c = T() );
Resizes the vector to contain
sz elements.
If
sz is smaller than the current vector , the content is reduced to its first
sz elements, the rest being dropped.
If
sz is greater than the current vector , the content is expanded by inserting at the end as many copies of
c as needed to reach a size of
sz elements. This may cause a reallocation.
Notice that this function changes the actual content of the vector by inserting or erasing elements from the vector; It does not only change its storage . To direct a change only in storage capacity, use instead.
转载地址:http://kveti.baihongyu.com/