Jump to content

Array data structure

From Simple English Wikipedia, the free encyclopedia
Revision as of 16:20, 7 January 2007 by Simeon (talk | changes) (new stub)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In programming languages, an array is a way of storing several items (such as integers). These items must have the same type (only integers, only strings, ...) because an array can't store different items. Every item in an array has a number so the programmer can get the item by using that number. This number is called the index.

When the programmer creates an array, he/she must give the size of the array. This is the number of items that can be stored in the array. If the programmer wants to store more items then he/she must create a new array. This is because the size of an array can't be changed.