# Can someone help me with basic array

## Recommended Posts

could someone explain what array (as in how value is found; is it the sum of elements in i?)

and wtf is array[ind] if it wasn't declared earlier

thx guys

##### Share on other sites

"ind" is your indice number, the array[ i ], i means the position in the array which accompanies an element in the array.

Say you have:

```int array[] = { 9, 8, 7, 6};
```

and then you type array[0] it will return the number 9 in the array list.

##### Share on other sites

```for(int i = 0; i < arrays.length; i++){
//Here is where I mean
}
```

Creates a loop that'll keep looping whilst the value of i is less than the length of the Array arrays.

In this case you're declaring a loop that initialises a value of i that starts at zero.

i++ means after each loop it'll increase the value of i by 1.

in the case of array, i is the index in the array defined above.

so on the first loop array would be 1, on the second loop 23, ect.

Although I have no idea what ind is or what kind of tutorials you're following.

Maybe someone else can clear that up

Oh I didn't read the full thing 0.0 I see why it has heaps of underscores now xD

Edited by Isolate
##### Share on other sites

thanks guys, i understand it now

but why would they put array[ind] instead of int[ind] seeing as it is only holding one value right?

nvm i get it, it records the index number

Edited by justanotherkid

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.