How to properly use arrays?
#10

Quote:
Originally Posted by rangerxxll
View Post
You said that there's 3 floating points, yet we're declaring 2 in the creation of the label. Couldn't we change [3] to [2] since they start at 0?

pawn Code:
new Float:fishingspots[MAX_FISH_AREAS][2] // starting from 0 <--
It's just the size for declaration, size is starting from 1 if you change it to 2, the compiler will complain
To access the index of the variable arrays, the number starts from 0
There is actually 3 items on each index:
0
1
2
You can't use number 3 for the index, except you are increasing the size to 4 then you can use until number 3
Reply


Messages In This Thread
How to properly use arrays? - by rangerxxll - 30.03.2014, 02:07
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:00
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:04
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:30
Re: How to properly use arrays? - by newbie scripter - 30.03.2014, 03:38
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:38
Re: How to properly use arrays? - by RoboN1X - 30.03.2014, 03:43
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:44
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:50
Re: How to properly use arrays? - by RoboN1X - 30.03.2014, 03:52

Forum Jump:


Users browsing this thread: 2 Guest(s)