Question about two dimensional arrays -order
#4

Well, I think it matters slightly when using sizeof. For example, to show all the 4 stats textdraw for a player in a loop:
pawn Код:
for(new i; i < sizeof(Stats[]); i++) // Text:Stats[MAX_PLAYERS][4]
{
    TextDrawShowForPlayer(playerid, Stats[playerid][i]);
}
// whereas
for(new i; i < sizeof(Stats); i++) // Text:Stats[4][MAX_PLAYERS]
{
    TextDrawShowForPlayer(playerid, Stats[i][playerid]);
}
Reply


Messages In This Thread
Question about two dimensional arrays -order - by Magic_Time - 21.09.2014, 18:00
Re: Question about two dimensional arrays -order - by Pottus - 21.09.2014, 18:30
Re: Question about two dimensional arrays -order - by Magic_Time - 21.09.2014, 18:58
Re: Question about two dimensional arrays -order - by Vince - 21.09.2014, 20:28

Forum Jump:


Users browsing this thread: 1 Guest(s)