I'm trying to delete all object from my memory but I'm not sure what also to delete and whats the best way.
void createAss(Object& object) {
Ass a1 = Ass("asdf");
Ass a2 = Ass("aaa");
object.addAss(a1);
object.addAss(a2);
}
int main(void) {
Object obj("header");
createAss(obj);
return 0;
}
So my main question is do I have to delete
a1, a2 and obj within the main function or should it be done by the Destructor of the certain class?