capacity函數(shù):size_type capacity(),返回當(dāng)前vector在重新進(jìn)行內(nèi)存分配以前所能容納的元素?cái)?shù)量。The size of the storage capacity currently allocated for thestring.size_t is an unsigned integral type.C++ 返回string分配的存儲容量。跟size不同,它返回的是分配的容量的大小,并不是string里面字符串的長度。..詳細(xì)