1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. In C++, new and delete are used for:

Added 30 Nov -0001

In C++, new and delete are used for:

  1. type casting between related classes
  2. dynamic allocation and release of objects Correct answer
  3. exception handling during program run time
  4. reading and writing files on a disk

Correct answer

B. dynamic allocation and release of objects

12 views

MCQSEXAM

Explanation

new allocates memory on the free store and calls the constructor; delete calls the destructor and releases the memory.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs