Difference between "capacity" and "size" functions ofstring class?
And "bb.capacity()" returns "15" on my computer, which is wierd, whereCode:#include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { string cc(31, 'c'); string bb=cc.assign(3, 'dd'); cout << bb.capacity() << endl; cout << bb.size() << endl; getchar(); }
did it come from?
Bookmarks