Difference between delete and delete[]?
Answer Posted / sunita shukla
Delete p deallocate memory pointed to by p and delete []p deallocate array. But delete p will delete only p[0]. Other array's Size-1 entries will not be deleted and this memory will leak.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Who invented turbo c++?
What are compilers in c++?
What is the difference between new() and malloc()?
What is the use of pointer in c++ with example?
What is the use of this pointer in c++?
What is the use of dot in c++?
What is format for defining a structure?
What can I safely assume about the initial values of variables which are not explicitly initialized?
Difference between Abstraction and encapsulation in C++?
What is an arraylist c++?
How a new operator differs from the operator new?
What are the different types of polymorphism in c++?
If there are two catch statements, one for base and one for derived, which should come first?
How compile and run c++ program in turbo c++?
What is data types c++?