int main() { Employee *e = new Employee(); delete e; delete e; ... delete e; return 0; }
You get undefined behaviour if you try to delete an object through a pointer more than once.
delete
This means that pretty much anything can happen from 'appearing to work' to 'crashing' or something completely random.
2.1m questions
2.1m answers
60 comments
57.0k users