In: Computer Science
When it comes to dynamic memory allocation and delete[] pointer, what does it mean to say that, CRT detected that the application wrote to memory after end of heap buffer?
I tried to duplicate the error by deleting the pointer address twice and it didn't produce the same error code so that's not it. What might cause this problem?
char* str = malloc(3);
OK, str now points to 3 chars on the heap.
Suppose you write 4 chars into that str:
buffer[0] = 'a';
buffer[1] = 'b';
buffer[2] = 'c';
buffer[3] = 'd';
now you have access the memory which is not allocated for you, now program will behave abnormally