class test {
char zip[5];
other_class *to_somewhere;
test *next;
};
.....
test *x = new test;
.....
delete x;
My questions are:
1. will "zip" be freed? if not, how can I delete those characters when x got deleted?
2. will both blocks of memory pointed by "to_somewhere" and "next" be freed? or just "to_somewhere" and "next" that will be deleted?
That didn't answer question two I don't believe. If you assign dynamically allocated memory to the pointers, they will not. But if they are never assigned to anything they will be deleted when out of scope.