|
-
April 13th, 2008, 04:30 AM
#1
a question about "delete"
I create 2 pointers to the same point. What happen when I use "delete" with the first pointer? Is the content of the second pointer detroyed?
-
April 13th, 2008, 04:59 AM
#2
Re: a question about "delete"
Yes but not the pointer itself (neither the first, nor the second) so after the delete both pointers points to invalid memory space.
-
April 14th, 2008, 01:09 AM
#3
Re: a question about "delete"
Next delete on second pointer should caous an exception. That why people discover smart pointers or auto pointers.
-
April 14th, 2008, 03:05 AM
#4
Re: a question about "delete"
macabre13, no the next delete on second pointer will cause undefined behaviour.
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
|