By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,118 Members | 853 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,118 IT Pros & Developers. It's quick & easy.

delete vs dealloc

P: n/a
Is "delete" equivalent to "dealloc"?
is it more efficent ?
can "delete" be used on variable of any type?

Thanks

Dec 20 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
cw***@hotmail.com wrote:
Is "delete" equivalent to "dealloc"?
What's dealloc?
can "delete" be used on variable of any type?
No, only on pointers allocated with new().

--
Ian Collins.
Dec 20 '06 #2

P: n/a
cw***@hotmail.com wrote:
Is "delete" equivalent to "dealloc"? is it more efficent ?
No idea. In standard C++, there is no such thing as "dealloc".
can "delete" be used on variable of any type?
No. It can only be used on pointers.

Dec 20 '06 #3

P: n/a
cw***@hotmail.com wrote:
Is "delete" equivalent to "dealloc"?
By "dealloc" do you mean free? If so, then no they are not equivalent,
'delete' also calls the objects destructor. You should always "delete"
something you "new" and "free" something you "malloc".
is it more efficent ?
It is neither more or less efficient.
can "delete" be used on variable of any type?
It can be used on any pointer type as long as the object pointed to was
created with "new".
Dec 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.