I am stuck on making use of my destructor My brief code structure is such that
class test
{
private:
string code;
int digit, num_digit;
//destructor
~test()
{
if(digit >= 0 && digit > num_digit)
{
for(unsigned int i=0; i<code.length(); i++) delete &code[i];
}
}
};
<more code> .............
<more code> .............
int main()
{
Test test1
test1.~test();
}
My core get aborted when going through the part for destructor. Unix complier says Aborted - 'core dumped' Any idea for it?