Hello,
I have a simple question. Look at the following code:
class ClsA {
int * var1;
ClsA();
~ClsA();
}
ClsA::ClsA(){
var1 = new int [10];
}
ClsA::~ClsA{
delete [] var1;
cout<<"Apel destructor";
}
void funct(){
ClsA ** p = new ClsA * [10];
.....
delete [] p;
}
When i give : " delete [] p " the destructor of ClsA is not automatically call! So, i must explicitly call the destructor? if i let only the " delete [] p " is enough? I will have memory lacks?
thanks!