int main(){
vector<string> test;
test.push_back("tes3235235et");
test.push_back("135125151241241241");
cout << test[0].capacity() << endl;
cout << test[1].capacity() << endl;
cout << &(test[0]) << endl;
cout << &(test[1]) << endl;
return 0;
Run Code Online (Sandbox Code Playgroud)
}
输出:
12
18
0x2508cb0
0x2508cb8