Arrays Flashcards
It is a variable with a single value
Scalar variable
a continuously allocated nonempty set of objects with a
particular member object type
Array
All you need to know when defining an array is
where the array starts
what type of data is in the array
how many elements are in the array
It is the members of the array
elements
Array variable declarations include
a data type
a variable name
ends with a semicolon
length
Array declaration syntax
type name [length];
To access a particular element of an array, we write
array name [integer value]
It is locating a particular element of an array
Array subscripting or indexing
Elements of an array of length n are indexed
from 0 to n-1
These elements of array subscripting are
lvalues
array declarations can include an
optional initialization
Scalar variables are initialized with
a single value
Arrays are initialized with
a list of values.
The initialization of arrays with a list is enclosed in
curly braces
The list is enclosed in curly braces is also referred to as
the initializer