What happens if you call delete this in the destructor?
delete essentially performs 2 operations:
1. explicit call of the object destructor and
2. freeing up the memory occupied by the object
So calling in the destructor delete this will lead to an infinite loop, which, in turn, will lead to a stack overflow and the program will crash.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты