a data type whose values are sequence of characters
string
pros of primitive strings (2)
cons of primitive strings
implementation is more complex
pros of array-of-char strings (2)
cons of array-of-char strings (2)
design issues of array types (7)
is arr[5.26] a valid array subscript?
yes (in javascript), but returns undefined
the type of the subscript is usually bound [statically/dynamically]
statically
the range of valid subscripts is usually bound [statically/dynamically]
dynamically
arrays differ in __ and __
when their size is known,
where they live in memory
on array categories:
range is bound statically and storage allocation is done before run time
static array
on array categories:
range is bound statically but storage allocation is done when the declaration is elaborated
fixed stack-dynamic array
on array categories:
range and storage are bound dynamically once elaborated
stack-dynamic array
on array categories:
range and storage are bound when the program requests them during execution
fixed heap-dynamic array
on array categories:
array can grow and shrink during program execution
heap-dynamic array
rectangular or ragged array?
rectangular array
rectangular or ragged array?
the number of columns for each row need not to be the same
ragged array
row or col major order?
array is stored by rows
row major order
row or col major order?
array is stored by cols
col major order