Difference between delete and delete[]?
Answer Posted / vikas
If p is pointer to an array and is allocated memory on
heap, then delete p would call the destructor of the first
element but will free up the whole block. More info at:
http://www.cppquestions.com/viewtopic.php?f=27&t=13
| Is This Answer Correct ? | 14 Yes | 5 No |
Post New Answer View All Answers
What is auto type c++?
what are function pointers?
What is iterator in c++?
What is the default width for ouputting a long integer using the insertion operator?
What is exception handling? Does c++ support exception handling?
What do you mean by function and operator overloading in c++?
What does override mean in c++?
How would you differentiate between a pre and post increment operators while overloading?
What is a template in c++?
What are the benefits of c++?
List different attributes in C++?
What is java and c++?
What is ostream in c++?
What are the advantages of c++ over c?
What does #define mean in c++?