Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the difference between delete and delete[] in C++?

a) delete is used to delete normal objects whereas delete[] is used to pointer objects
b) delete is a keyword whereas delete[] is an identifier
c) delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects
d) delete is syntactically correct but delete[] is wrong and hence will give an error if used in any case

Answer: c
Explanation: delete is used to delete a single object initiated using new keyword whereas delete[] is used to delete a group of objects initiated with the new operator.

Join The Discussion