此浏览器不再受支持。
请升级到 Microsoft Edge 以使用最新的功能、安全更新和技术支持。
vector::resize
void resize(size_type n, T x = T());
The member function ensures that size() henceforth returns n. If it must lengthen the controlled sequence, it appends elements with value x.
size
()
n
x
See the related sample program.