Arrays

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

8 Terms

1
New cards

Use

storing and managing bigger blocks of data

provide a simple way of storing multiple instances ‘a sequence’ of the same data type

2
New cards

Declaring

int aListOfInts[5]; //array of 5 integers

3
New cards

Indexed from…

0

4
New cards

Initialiser

can initialise only part of the array

starting from 0

int aListOfInts[5] = {1, 2, 3, 4, 5};
aListOfInts[0] = 5; //overwriting the 1st

5
New cards

Arrays

named contiguous data blocks in memory

don’t know how many elements are initialised

6
New cards

Arrays won’t Grow if…

you access memory before or after the allocated space

7
New cards

Array Bounds

C compiler won’t protect you

need to track these yourself and code defensively

8
New cards

Printing a Value in an Array

printf("Element 3 is %d\n", aListOfInts[2]);