Chapter 7 Flashcards
- The _________ indicates the number of elements, or values, an array can hold.
size declarator
- The size declarator must be a(n) _________ with a value greater than _________.
integer, 0
- Each element of an array is accessed and indexed by a number known as a(n) _________.
subscript
- Subscript numbering in C++ always starts at _________.
0
The number inside the brackets of an array definition is the _________, but the number
inside an array’s brackets in an assignment statement, or any other statement that
works with the contents of the array, is the _________
size declarator, subscript
C++ has no array _________ checking, which means you can inadvertently store data
past the end of an arra
bounds
- Starting values for an array may be specified with a(n) _________ list.
initialization
- If an array is partially initialized, the uninitialized elements will be set to _________.
0
If the size declarator of an array definition is omitted, C++ counts the number of items
in the _________ to determine how large the array should be
initialization list
By using the same _________ for multiple arrays, you can build relationships between
the data stored in the arrays
subscript
You cannot use the _________ operator to copy data from one array to another in a
single statement.
=
Any time the name of an array is used without brackets and a subscript, it is seen as
_________
an address
- To pass an array to a function, pass the _________ of the array.
address, or name
- A(n) _________ array is like several arrays of the same type put together.
multi-dimensional
- It’s best to think of a two-dimensional array as having _________ and _________.
rows, columns
- To define a two-dimensional array, _________ size declarators are required.
two
When initializing a two-dimensional array, it helps to enclose each row’s initialization
list in _________.
braces
When a two-dimensional array is passed to a function the _________ size must be
specified
column
The ____________________ is a collection of programmer-defined data types and
algorithms that you may use in your programs
Standard Template Library (or STL)
- The two types of containers defined by the STL are ___________ and ______________.
sequence and associative
- The vector data type is a(n) ______________ container.
sequence
To define a vector in your program, you must #include the ____________ header
file
vector
To store a value in a vector that does not have a starting size, or that is already full,
use the ________________ member function
push_back
To determine the number of elements in a vector , use the _____________ member
function
size
- Use the ________________ member function to remove the last element from a vector .
pop_back
- To completely clear the contents of a vector , use the ___________ member function.
clear