SA-MP Forums Archive
Error sizeof. - 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: Error sizeof. (/showthread.php?tid=514090)



Error sizeof. - TheSy - 19.05.2014

Hello!

I have this error:
warning 224: indeterminate array size in "sizeof" expression (symbol "")

In this line:
for(entry = 0; entry < sizeof(WeedInfo); entry++)

How to resolve?

THX!


Re: Error sizeof. - JFF - 19.05.2014

pawn Код:
for(entry = 0; entry < WeedInfo; entry++)
U tried that?


Re: Error sizeof. - TheSy - 19.05.2014

error 033: array must be indexed (variable "WeedInfo").


Re: Error sizeof. - ball - 19.05.2014

Put your code of creating WeedInfo


Re: Error sizeof. - TheSy - 19.05.2014

Only enum?

pawn Код:
enum WInfo
{
    ID,
    VW,
    Inte,
    Planteur,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Variete,
    Temps,
    Grammes
};
new WeedInfo[][WInfo];



Re: Error sizeof. - TheSy - 20.05.2014

up............


Re: Error sizeof. - Konstantinos - 20.05.2014

You need to use some size such as:
pawn Код:
new WeedInfo[50][WInfo];
Change 50 to how many Weeds you want to be stored.


Re: Error sizeof. - TheSy - 20.05.2014

Yes but I do not want to limit, that's the rub.


Re: Error sizeof. - RajatPawar - 20.05.2014

I'm sure you don't need more than MAX_PLAYERS, so that should do it, yes? (Ignore what it implies, but you definitely shouldn't need MORE than 500!)

If you are scared of over-riding the 50 limit - you can use assert (if your variable is const)