Error sizeof.
#1

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!
Reply
#2

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

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

Put your code of creating WeedInfo
Reply
#5

Only enum?

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

up............
Reply
#7

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

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

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)