Problem with defining.
#1

I have one define that's: #define AUTOLIIMIT 100
And variable: new autosysteem;

I've tried that: new CarInfo[AUTOLIIMIT+autosysteem][cInfo];

But it will show errors and warnings.

Any idea how fix that problem? Thanks!

Error & Warning
Код:
 error 008: must be a constant expression; assumed zero
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
 warning 224: indeterminate array size in "sizeof" expression (symbol "") 
 warning 224: indeterminate array size in "sizeof" expression (symbol "")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

You can't do it like that. I just posted this but it explains exactly why you can't.
http://forum.sa-mp.com/showthread.ph...=pawn-lang.pdf

pawn Код:
new CarInfo[AUTOLIIMIT][cInfo];
Reply
#3

Then how do it.. :/ I need add too "autosysteem" value (to AUTOLIIMIT for CarInfo)
Reply
#4

If your saving information about each vehicle, new CarInfo[MAX_VEHICLES][cInfo]; Is enough to record information about every vehicle since the limit is 2000.

Array sizes cannot be changed dynamically by using a variable as the size since they are handled by the Pre-Processor.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)