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 the use of "new" operator?
Explain one method to process an entire string as one unit?
Is it possible for the objects to read and write themselves?
Can non graphic characters be used and processed in C++?
Difference between a homogeneous and a heterogeneous container
Why do we use classes in c++?
Define whitespace in C++.
Define virtual constructor.
What is == in programming?
What apps are written in c++?
Which is better c++ or java?
What is a Default constructor?
what is the difference between overloading & overriding? give example.
What is a lambda function c++?
Why are arrays usually processed with for loop?