Arrays Flashcards

1
Q

It is a variable with a single value

A

Scalar variable

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

a continuously allocated nonempty set of objects with a
particular member object type

A

Array

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

All you need to know when defining an array is

A

where the array starts
what type of data is in the array
how many elements are in the array

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

It is the members of the array

A

elements

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

Array variable declarations include

A

a data type
a variable name
ends with a semicolon
length

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

Array declaration syntax

A

type name [length];

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

To access a particular element of an array, we write

A

array name [integer value]

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

It is locating a particular element of an array

A

Array subscripting or indexing

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

Elements of an array of length n are indexed

A

from 0 to n-1

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

These elements of array subscripting are

A

lvalues

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

array declarations can include an

A

optional initialization

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

Scalar variables are initialized with

A

a single value

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

Arrays are initialized with

A

a list of values.

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

The initialization of arrays with a list is enclosed in

A

curly braces

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

The list is enclosed in curly braces is also referred to as

A

the initializer

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

If the list / initializer is shorter than the array,

A

the remaining elements of
the array are given the value of 0.

17
Q

It is illegal for an initializer to be

A

completely empty

18
Q

How can we check the size of the array?

A

Using the sizeof operator

19
Q

A compile-time unary operator

A

sizeof operator

20
Q

Used to calculate the size of its operand

A
21
Q

Returns the size of a variable

A
22
Q

Gives the size in the unit of byte

A
23
Q

used for any data type such as primitives like int, float, char, and also
non-primitives data type as an array, struct

A

sizeof operator

24
Q

sizeof operator returns the ____ allocated to that data typr

A

memory

25
Q

sizeof operator returns the ___ of a variable

A

size

26
Q

sizeof operator syntax

A

sizeof(operand)

27
Q

The operand in the sizeof operator may be a

A

data type
any operand

28
Q

How can we compute for the length of the array?

A

Array length = size of array/ size of 1 array element