teach-ict.com logo

THE education site for computer science and ICT

1. Introduction to Arrays

There are many different ways to organise data, and each way is called a "data structure". One such data structure is called an 'array'.

For example, say you wanted to to store the names of players in a football team. The team has 11 players.

One way, is to store the names as independent variables,

Like this:

               player1 = "John Smith"

               player2 = "Harry Potter"

               player3 = "Jimmy Carr"
                 ... and so on

So there would be eleven variables. The problem with this is it does not show that there is relationship between the names - that they are all part of the same football team. This is why an array data store is useful - it allows related data item to be stored as a group.

 

image