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
How do I use turbo c++?
What is a linked list in c++?
What's the hardest coding language?
What is a class template?
What is iterator in c++?
Explain what are the sizes and ranges of the basic c++ data types?
Can I learn c++ as my first language?
What is the use of vtable?
What is & in c++ function?
Can we sort map in c++?
What do you understand by pure virtual function? Write about its use?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
Differentiate between late binding and early binding. What are the advantages of early binding?
Does c++ support multilevel and multiple inheritances?
What is the use of typedef?