Hello, I was just experimenting with arrays and noticed that after ths code:
Code:
var array_test[2][9];
array_test[1][1]= 1;
array_test[2][10]=4;
The engine still works with fine with this,but I would expect an error, isn't the array out-of-bounds at [2][10]? Why will it still accept data at that location?
Last edited by NITRO777; 04/22/1117:06. Reason: spelling
Re: a question about arrays
[Re: NITRO777]
#368203 04/22/1117:0704/22/1117:07
Lite-C doesn't have bounds checking, so by writing to invalid indices adjacent memory is overwritten. This can cause random crashes (depending on what is overwritten).
Re: a question about arrays
[Re: Myrkling]
#368204 04/22/1117:1704/22/1117:17