Arrays Flashcards

1
Q

older and more basic than vector is the

A

arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

blank are sequences of objects of the same type

A

arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

objects in arrays are allocated blank in memory

A

sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

items can be accessed with [] operator

A

no .at()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

once allocated the blank of an array cannot be changed

A

the size of the array cannot be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or false:

the size of the array itself is not stored with the array itself

A

True

size of the array itself is not stored with the array itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

to declare an array, specify the type and size

A

int numbers[5];

bool flags[10];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

the blank precedes the variable name

the blank is specified in the [ ] after it

A

the type precedes the variable name

the size is specified in the [ ] after it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

arrays can be given blank

A

arrays can be given initial values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

if not given blank, the items in the array are undefined random memory garbage until assigned

A

initial values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
to write a function that accepts an array as an argument, declare it like a normal array, but omit the length of the array from the [ ], and supply it as another argument: 
int sum(int numbers{ }, int length)
A

it’s important to supply the length because otherwise the function can’t figure out how large the array is

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

you can declare the array argument to be a blank

A
pointer
int sum(Int* numbers, int length)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly