I have a question that has been in the back of my mind for a while now and up to now I have assumed that the objects are destroyed after the function call but this is the question I have.
If I have a method that returns a pointer such as
WORD* myclass::Dosomething()
{
WORD* MyWrdPtr = new WORD [4];
WORD* MyOtherWrdPtr = new WORD [4];
WORD* w_res = new WORD [8];
// Do something and then
return w_res;
}
Do I need to delete the other two WORD pointers or are they automatically
destroyed ?