KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know that when delete [] will cause destruction for all array elements and then releases the memory. I initially thought that compiler wants it just to call destructor for all elements in the array, but I have also a counter - argument for that which is: Heap memory allocator must know the size of bytes allocated and using sizeof(Type) its possible to find no of elements and to call appropriate no of destructors for an array to prevent resource leaks. So my assumption is correct or not and please clear my doubt on it. So I am not getting the usage of [] in delete [] ?
Tags (comma-separated)
Save Edits
Cancel