I'm using auto_ptr<>
which uses an array of class pointer type so how do I assign a value to it.
e.g.
auto_ptr<class*> arr[10];
How can I assign a value to the arr
array?
You cannot use auto_ptr with array, because it calls delete p
, not delete [] p
.
You want boost::scoped_array or some other boost::smart_array :)