vendredi 9 août 2019

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

This question already has an answer here:

I have found on this website that delete is used for single object deletion and delete[] for multiple objects. If we invoke delete on an array of objects, it invokes destructor for first object and then there is segmentation fault. Can anyone explain how this leads to segmentation fault?

Aucun commentaire:

Enregistrer un commentaire