Why does this work?

BlitzMax Forums/BlitzMax Programming/Why does this work?



So to acurately describe what is happening above, say, Orange is my actual array and size, lets say one byte. Green is free memory that currently isnt being allocated anywhere. Red is memory that has been allocated by some other program, or some other variable in the program.

So is it correct to say, if I write outside of the arrays index, to a green area of memory, it would still function as if the array was large enough to have that variable in index, provided the program doesnt assign some data to that area as it doesnt know its being referenced. But if I went and tried to write data to the array that happened to be in the red area, that would give me an Unhandled Memory Exception right?