Why does my program crash when I increment a pointer and then delete it?
It’s actually the statement after the one you mark as causing the program to crash that causes the program to crash! You must pass the same pointer to delete[] as you get back from new[]. Otherwise the behaviour of the program is undefined.