|
-
April 25th, 2002, 06:09 AM
#1
delete vs. delete []
Hi,
Does anyone know if there is possible to decide in runtime either to call:
delete someptr;
or
delete [] someptr;
What about smart pointers? How do they know which one to call?
Kjetil Haga
-
April 25th, 2002, 06:27 AM
#2
Re: delete vs. delete []
Hi again...
I've taken a look at boost and they have a separate smart pointer for arrays (shared_array). Since the boosters have made a separate class for handling dynamic arrays, I guess this is not possible. Please correct me if I'm wrong....
Thanks.
Kjetil
-
April 25th, 2002, 10:10 AM
#3
Re: delete vs. delete []
the solution is never to use arrays and then you need never use delete []
use std::vector instead of arrays.
The best things come to those who rate
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
|