P
puzzlecracker
interesting case:
class MyString{
char * strRep; // initialized to char array
public:
~MyString(){delete strRep;} //why would this work
// just like 'delete [] strRep;'
};
isn't delete first calls the destructor for the object and then
deallocates the memory (by operator delete)?
class MyString{
char * strRep; // initialized to char array
public:
~MyString(){delete strRep;} //why would this work
// just like 'delete [] strRep;'
};
isn't delete first calls the destructor for the object and then
deallocates the memory (by operator delete)?