> why do we use ' delet[] ' statement for arrays while using dyamic memory
> allocation for 'new.........delet ' statements & don't use '[]' for
> 'malloc.....free' statements?
In C, there are no destructors to call. The developer has to handle the
uninitialization of his objects himself.
In C++, it is important to know if a pointer points to a single object or
to an array of objects. If it points to an array, for every one delete []
invokes the object's destructor.
Regards,
Will
Because new and delete are C++ operators in the language and malloc is a
function call.
> why do we use ' delet[] ' statement for arrays while using dyamic memory
> allocation for 'new.........delet ' statements & don't use '[]' for
> 'malloc.....free' statements?