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?
std::string *myStr
str::auto_ptr<std::string>
Do I have to delete/destory any of these objects or does the compile takes care of it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://cprogramming.com/tutorial/auto_ptr.html
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
Sara
Heh, I don't think that's the point of the question, Sara ;)
sorry, i always overact when i see pointers :)
Sara
Sara
ASKER
got it