This question already has an answer here:
- Is delete[] equal to delete? 6 answers
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