summaryrefslogtreecommitdiff
path: root/c,cc/pointer_to_element.cc
blob: 5a11919529342e2ace66fee830e5612b14195164 (plain)
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;
}