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 do you mean by stack unwinding in c++?
Is c++ an oop?
Describe public access specifiers?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
Why pointer is used in c++?
Why is "using namespace std;" considered bad practice?
Comment on c++ standard exceptions?
What is the difference between object-oriented programming and procedural programming?
What is meant by entry controlled loop?
What are virtual constructors/destructors?
Tell me an example where stacks are useful?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What is time h in c++?
What is the v-ptr?
What is the array and initializing arrays in c++?