vectorresize错误⽤法vector<int> v;
v.push_back(3);
v.push_back(3);
resize函数c++cout << v.size() << " " << v.capacity() << endl; //2 2
v.clear();
cout << v.size() << " " << v.capacity() << endl; //0 4
cout << v.size() << " " << v.capacity() << endl; //0 4

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。