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
What are the differences between java and c++?
What is meant by iomanip in c++?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
what is multi-threading in C++?
What is :: operator in c++?
What are the comments in c++?
Define a nested class.
What is runtime errors c++?
What is iostream in c++ used for?
Can manipulators fall in love?
Define 'std'.
What do you mean by function and operator overloading in c++?
Why do we use vector in c++?
What is a manipulative person?
What's the order in which the local objects are destructed?