Question 80Asked in BPSC TRE 2.0 (2023) Computer Class 9-10

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

  1. ADelete is syntactically correct but delete[ ] is wrong and hence will give an error if used in any case
  2. BDelete is used to delete normal objects whereas delete[ ] is used to delete pointer objects
  3. CDelete is used to delete single object whereas delete[ ] is used to delete multiple (array/pointer of) objects
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Delete is used to delete single object whereas delete[ ] is used to delete multiple (array/pointer of) objects

Explanation

delete frees a single object, while delete[] frees an array of objects (and calls each destructor).

From BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper

This is question 80 of BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.