So given this c structure:
typedef struct {
    int* arr1;
    int* arr2;
} myStruct;
This answer described using a single malloc to allocate a myStruct and it's arrays at the same time:
myStruct* p = malloc(sizeof(*p) + 10 * sizeof(*p->arr1) + 10 * num * sizeof(*p->arr2);
if(p != NULL) {
    p->arr1 = (int*)(p + 1);
    p->arr2 = p->arr1 + 10;
}
What I'd like to know is there a similar way to do this with new?
Obviously I want to be able to allocate to a size that I receive at runtime as is done with the C example.
 
     
     
     
    