compliant variable length struct in C++
问题 In standard C you can end a struct with an array of size 0 and then over allocate it to add a variable length dimension to the array: struct var { int a; int b[]; } struct var * x=malloc(sizeof(var+27*sizeof(int))); How can you do that in C++ in a standard (portable) way? It is okay to have a constraint of max posible size and obviously doesn't have to work on the stack I was thinking of: class var { ... private: int a; int b[MAX]; }; and then use allocators or overload new/delete to under