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 iostream in c++ used for?
What is srand c++?
Define pre-condition and post-condition to a member function in c++?
What is atoi in c++?
How is new() different from malloc()?
What is class definition in c++ ?
What is ios flag in c++?
What is the difference between struct and class?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
Write a program in C++ for Fibonacci series
What is a catch statement?
Specify some guidelines that should be followed while overloading operators?
What are shallow and deep copies?
Why namespace is used in c++?
Can constructor be private in c++?