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.
1.4m articles
1.4m replys
5 comments
57.0k users