|
-
November 15th, 2006, 04:58 AM
#1
auto_ptr and arrays
Hi all:
I am using auto_ptr for ordinary pointers with no problem but i have a doubt about using it with arrays.
I have an auto_ptr<char>, but what I assign to is a char[] instead of an unique char.
If i use new, i must use delete for deletion, but if I use new[], i must use delete[], but here is auto_ptr the responsible of doing the delete. Wil the auto_ptr do the appropiate delete (normal or [])
If the answer is no, do you have another alternative for guarantee deletion of array.
NOTE: I cannot use vector<char> nor any other container. It must be a char array due to the API i use.
Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|