hi,
If I have a C struct in C++ like the following:
struct {
int a;
int b;
int c[100];
char d[20];
char *ptr;
}X;
....
I do the following:
..
..
X *ptrX = new X;
ptrX->ptr = new char[200];
..
..
..
delete(ptrX);
Does delete automatically remove memory allocated for ptrX->ptr?
Or does this lead to memory leak and I need to remove heap memory
specifically by doing delete(ptrX->ptr) first ?
Thanks
hs