[ create a new paste ] login | about

Link: http://codepad.org/mTvWj83Z    [ raw code | output | fork ]

C++, pasted on Aug 25:
1
2
3
4
5
6
7
8
9
10
#include <cstdio>
#include <vector>

int main(void)
  {
  vector < vector <int> > v(10, vector <int> (10,1));
  printf("%d + %d*%d + %d*%d", sizeof v, v.capacity(), sizeof v[0], v[0].capacity(), sizeof v[0][0]);
  printf(" = %d\n", sizeof v + v.capacity() * sizeof v[0] + v[0].capacity() * sizeof v[0][0]);
  return 0;
  }


Output:
1
28 + 10*28 + 10*4 = 348


Create a new paste based on this one


Comments: