11.05.2013, 09:04
Somewhere in your code you are trying to do this:
Obviously you can't access the index -1, doing so will cause undefined behavior. It wont look like the above code because that would be a compile time error. It could be more similar to this:
Which will be a run time error.
And fix it by checking if the variable is '-1' before using it as an array index.
pawn Код:
array[-1]
pawn Код:
#define INVALID_SOMETHING -1
new index = INVALID_SOMETHING;
array[ index ];
And fix it by checking if the variable is '-1' before using it as an array index.