An array stores many values under one name, side by side in memory. Each box gets an index — and counting starts at zero.
1 Declaration
int a[5] reserves five int boxes in one unbroken block of memory.
2 Indexing
a[0] is the first box and a[4] the last — valid indexes run from 0 to size - 1.
3 Initializer
int a[3] = {7, 8, 9} fills all three boxes right at declaration.
4 No guard rails
C never checks your index. a[5] on a size-5 array reads past the end silently.
A row of numbered boxes
Declaration1int a[5] reserves five int boxes in one unbroken block of memory. Indexing2a[0] is the first box and a[4] the last — valid indexes run from 0 to size - 1.
Initializer3int a[3] = {7, 8, 9} fills all three boxes right at declaration. No guard rails4C never checks your index. a[5] on a size-5 array reads past the end silently. 4 building blocks make up A row of numbered boxes
No searching — just one multiplication and one addition. Click each stage to follow the address math.
Press play — watch the loop visit each index and fold every value into the running total.
preprocessThe preprocessor pastes in stdio.h.
Memory
no variables yet — press play
Console
output appears as the program runs…
Click a term, then click its meaning to lock the pair.
5 conceptsTap a card to expand ?int a[5]drops into place
?a[0]drops into place
?a[4]drops into place
?{7, 8, 9}drops into place
?a[i]drops into place
Two reads and one overwrite — keep the indexes straight.
Your predicted output — one line per console line
Hint: a[1] is the second box and a[3] the fourth — and a[0] = a[2] - 1 overwrites the first box with 5.
01One name, many boxes: int a[5] is five ints side by side.
02Counting starts at 0; the last index is always size - 1.
03C never checks indexes — staying in bounds is your job.
04The compiler finds a[i] with simple math: base + i × size.
05Loops plus arrays are best friends: for (int i = 0; i < size; i = i + 1).