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; }
1
Size: 44