[ create a new paste ] login | about

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

C++, pasted on Dec 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;

struct A
{
  struct B
  {
   int a;
  };

  B member[1];

  static int Size( int count ) { return sizeof( A ) + count * sizeof( B[1]); }

};

int main()
{
 std::cout<<"Size: " << A::Size( 10 ) << std::endl;
return 0;
}


Output:
1
Size: 44


Create a new paste based on this one


Comments: