Arrays

Subtitle


Key terms

Array

A data structure that holds a set number of values under a identifier.

Element

A item in the array.

Index

A position within the array.

Example

These examples will be done in a C like language

Creating an array

int array[5] = {1,2,3,4,5}

Getting the first item

print(array[0])
1

Getting the last item

print(array[-1])
5