PDA

View Full Version : Error sizeof.


TheSy
19/05/2014, 05:33 PM
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!

JFF
19/05/2014, 05:36 PM
for(entry = 0; entry < WeedInfo; entry++)


U tried that?

TheSy
19/05/2014, 06:00 PM
error 033: array must be indexed (variable "WeedInfo").

ball
19/05/2014, 06:02 PM
Put your code of creating WeedInfo

TheSy
19/05/2014, 06:06 PM
Only enum?

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

TheSy
20/05/2014, 10:10 AM
up............

Konstantinos
20/05/2014, 10:16 AM
You need to use some size such as:

new WeedInfo[50][WInfo];

Change 50 to how many Weeds you want to be stored.

TheSy
20/05/2014, 10:29 AM
Yes but I do not want to limit, that's the rub.

RajatPawar
20/05/2014, 10:30 AM
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)