Y
ypjofficial
Hello All,
In my program I am using a pointer to a vector
vector<XYZ> * vptr = new vector<XYZ>;
and also the XYZ class has a char* as one of its member.I have created
all the copy constructor, assignment operator and destructor (The Big
Three ) for XYZ.
My question is how to free the memory held by vptr?
shall i do delete vptr or
vptr->Clear() is enough?
(In both the cases the destructor of the XYZ objects are called..)
regards,
Yogesh Joshi
In my program I am using a pointer to a vector
vector<XYZ> * vptr = new vector<XYZ>;
and also the XYZ class has a char* as one of its member.I have created
all the copy constructor, assignment operator and destructor (The Big
Three ) for XYZ.
My question is how to free the memory held by vptr?
shall i do delete vptr or
vptr->Clear() is enough?
(In both the cases the destructor of the XYZ objects are called..)
regards,
Yogesh Joshi