1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <vector> #include <iostream> using namespace std; int main(void) { vector<char> bla; bla.reserve(2); bla.push_back('a'); char* p = &bla.at(0); cout << *p << endl; bla.push_back('b'); cout << *p << endl; return 0; }