SA-MP Forums Archive
sizeof array - 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)
+--- Thread: sizeof array (/showthread.php?tid=397924)



sizeof array - RedFusion - 07.12.2012

pawn Код:
new Float:RaceCoords[3][][3] =
{
    {
        {1217.486938,1440.017822,6.431724},// < I want the value of all these lines
        {1335.517211,2445.356445,6.429968}
    },
    {
        {1217.486938,1440.017822,6.431724},// < Not these
        {1335.517211,2445.356445,6.429968}
    },

};
How do i get the size of a part of an array?

I Keep getting this error
Код:
C:\Users\Simon\Desktop\Samp server\filterscripts\frace.pwn(262) : error 001: expected token: "]", but found "-integer value-"
C:\Users\Simon\Desktop\Samp server\filterscripts\frace.pwn(262) : warning 215: expression has no effect
C:\Users\Simon\Desktop\Samp server\filterscripts\frace.pwn(262) : error 001: expected token: ";", but found "]"
C:\Users\Simon\Desktop\Samp server\filterscripts\frace.pwn(262) : error 029: invalid expression, assumed zero
C:\Users\Simon\Desktop\Samp server\filterscripts\frace.pwn(262) : fatal error 107: too many error messages on one line
from
pawn Код:
printf("%i", sizeof(RaceCoords[][][0]) );



Re: sizeof array - Vince - 07.12.2012

Brackets must always be left empty when using sizeof. To get the size of the third dimension you also use only two pair of brackets.


Re: sizeof array - RedFusion - 07.12.2012

How am i supposed to do then? Any solutions?