30.08.2015, 08:13
A PAWN array's index starts from 0. This means that if you do "new Array[2];", you will be able to access Array[0] and Array[1]. Any other cells won't have any memory allocated, so trying to access them will result in an error (Array[2], Array[3] etc). If, for some reason, you want to skip index 0 and start from 1, you have to declare your initial array 1 cell bigger, so if you have 2 elements that you want to store in this kind of array, you will have to do "new Array[3];". Then, you will be able to access them by "Array[1]" and "Array[2]". But this means that you will keep 1 cell of memory occupied but not used, which is not good practice. Sure, you can do this in a specific place where it would be way harder to do it correctly (starting from 0), but don't even think to do it everywhere.


