I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allo
Use operator new and delete:
struct STRUCT { void *operator new (size_t) { return new char [sizeof(STRUCT) + nPaddingSize]; } void operator delete (void *memory) { delete [] reinterpret_cast (memory); } }; void main() { STRUCT *s = new STRUCT; delete s; }