Link to home
Start Free TrialLog in
Avatar of learningunix
learningunix

asked on

auto_ptr

Is there any difference betwwen the following declaration

std::string *myStr

str::auto_ptr<std::string> myStr;

Do I have to delete/destory any of these objects or does the compile takes care of it?
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you might not find a reason for using a std::string pointer at all. std::string has dynamic management of internal buffer and reference counting. you won't get a benefit when using pointers rather than objects.

Sara
Heh, I don't think that's the point of the question, Sara ;)
sorry, i always overact when i see pointers :)

Sara
Avatar of learningunix
learningunix

ASKER

got it