SA-MP Forums Archive
howto calculate Sizeof twodimensional arrays? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: howto calculate Sizeof twodimensional arrays? (/showthread.php?tid=146021)



howto calculate Sizeof twodimensional arrays? - DJ-CJ89 - 05.05.2010

I know for this new blah[array]; >>>>> sizeof(blah)

But i want to know a function to calculate twodimensionalarrays:
if i do for new blah[playerid][8]; i get an error if i do sizeof(blah[playerid]).

Any Ideas?


Re: howto calculate Sizeof twodimensional arrays? - Kyosaur - 05.05.2010

That is a very good question. I honestly dont even know the answer either lol. I've always hated how sizeof never worked with multidimensional arrays.



Re: howto calculate Sizeof twodimensional arrays? - Zeex - 05.05.2010

pawn Код:
sizeof blah[] // size of the second dimension



Re: howto calculate Sizeof twodimensional arrays? - ¤Adas¤ - 05.05.2010

Quote:
Originally Posted by Zeex
pawn Код:
sizeof blah[] // size of the second dimension
Zeex, and don't you know how to get size of variable in enum?


Re: howto calculate Sizeof twodimensional arrays? - Zeex - 05.05.2010

Unfortunately no I tried several ways but it didn't work


Re: howto calculate Sizeof twodimensional arrays? - ¤Adas¤ - 05.05.2010

Quote:
Originally Posted by Zeex
Unfortunately no I tried several ways but it didn't work
It's a pity. I tried too, but I think, there is a way to do this. But no one knows