array index out of bounds
#2

The enum variable always saves next unused constant number

Lets start in our enum
pawn Код:
enum CTask //normal mode (+= 1)
{
    int:iSleep, // = 0
    int:iRemainingTime, // = 1
    int:iType, // = 2
    sParam1[256], // = 3 - 258
    sParam2[256], // = 259 - 514
    bool:bActive = false, //normally 515 but we set it to 0 again
}; // => last constant number + 1 step => CTask = 1

new pTasks[MAX_TASKS][CTask];
Now it should be clear why the out of bounds error appeared

Since all variables are by default 0 (false) you dont need to set bActive to false
Reply


Messages In This Thread
array index out of bounds - by Rickye - 28.06.2011, 00:22
AW: array index out of bounds - by Nero_3D - 28.06.2011, 01:46
Re: array index out of bounds - by Rickye - 28.06.2011, 05:11

Forum Jump:


Users browsing this thread: 4 Guest(s)