What happens if I set a value outside of the memory allocated with calloc?
问题 Consider the following: int* x = calloc(3,sizeof(int)); x[3] = 100; which is located inside of a function. I get no error when I compile and run the program, but when I run it with valgrind I get an "Invalid write of size 4". I understand that I am accessing a memory place outside of what I have allocated with calloc, but I'm trying to understand what actually happens. Does some address in the stack(?) still have the value 100? Because there must certainly be more available memory than what I