11- defining arrays, arrays with for-loops, passing arrays as arguments Flashcards

1
Q

Aggregate construct

A

a construct that allows manipulation of multiple entities as a single entity

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

Array

A

a collection of variables called (array) elements or indexed variables
array is an aggregate construct

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

Name of the array

A

the same for all elements of single array

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

Index (or subscript)

A

different for element, put in square brackets []

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

(array) base type

A

type of the array elements
all elements have the same type

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

array size

A

number of elements

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

array declaration

A

int score[5];
the number in brackets: 5 is array size
the indexes start from 0. Above statement declares the following variables:
score[0], score[1], score[2], score[3], score[4]
note, score[5] is not there!

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

Scalar variable

A

non array (regular) variable

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

out-of-range error

A

referring to index that is not in array
it is a logical error (bug/run-time error) with unpredictable consequences.
these are both out-of-range errors a[10]=55; a[myvar]=5;

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

const

A

const type modifier specifies that the parameter shall not be modified in the function
that is, it turns accidental value change into compile-time error

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