Compare and contrast dynamic memory allocation and deallocation operators new, new [], delete and delete [].

What will be an ideal response?

Operator new creates an object and dynamically allocates space in memory for that object. Operator delete destroys a dynamically allocated object and frees the space that was occupied by the object. Operators new [] and delete [] are used to allocate and deallocate arrays dynamically. Operator delete [] ensures that the destrctor is called for each element in the array before the array is reclaimed.

Computer Science & Information Technology

You might also like to view...

Objects in a form that display data or perform actions are called ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

A(n) ________ is specific to a chart that displays a relationship between two sets of numbers plotted as data points with coordinates on a grid

Fill in the blank(s) with correct word

Computer Science & Information Technology