click below
click below
Normal Size Small Size show me how
Arrays & Strings
Question | Answer |
---|---|
A data type is simple if variables of that type can hold only ___ value at a time | one |
In a structured data type, each data item is a ___ of other data items | collection |
An ___ is a structured data type with a fixed number of components. Every component is of the same type, and components are accessed using their relative positions in the array | array |
___ of a one-dimensional array are arranged in the form of a list | elements |
There is ___ check on whether an array index is out of bounds | no |
In C++, an array index starts with ___ | 0 |
An array index can be any expression that evaluates to a nonnegative integer. The value of the index must always be less than ___ | the size of the array |
Arrays can be initialized during their declaration. If there are fewer initial values than the array size, the remaining elements are initialized to ___ | 0 |
The base address of an array is the address of the ___array component. For example, if list is a one-dimensional array, the base address of list is the address of list[0] | first |
In a function call statement, when passing an array as an actual parameter, you use ___ its name | only |
As parameters to functions, arrays are passed by ___only | reference |
Because as parameters, arrays are passed by reference only, when declaring an array as a formal parameter, you do not use the symbol ___ after the data type | & |
A function cannot return a value of type ___ | array |
Although as parameters, arrays are passed by reference, when declaring an array as a formal parameter, using the reserved word ___ before the data type prevents the function from modifying the array | const |
Individual array components can be passed as ___ to functions | parameters |
The sequential __ algorithm searches a list for given item, starting with first element in list. It continues to compare search item with other elements in list until either item is found or list has no more elements left to be compared with search item | search |
In C++, a string is any sequence of characters enclosed between ___ | double quotation marks |
In C++, C-strings are ___ terminated | null |
In C++, the null character is represented as ___ | '/0' |
In the ASCII character set, the collating sequence of the ___character is 0 | null |
C-strings are stored in ___ arrays | character |
___ arrays can be initialized during declaration using string notation | character |
Commonly used C-string manipulation ___ include strcpy (string copy), strcmp (string comparison), and strlen (string length). | functions |
C-strings are compared ___ | character by character |
Because C-strings are stored in ___, individual characters in the C-string can be accessed using the array component access notation | arrays |
In a ___ array, the elements are arranged in a table form | two-dimensional |
To access an element of a two-dimensional array, you need a pair of indices: one for the ___ position and one for the ___________ position | row column |
In a two-dimensional array, the rows are numbered 0 to ROW_SIZE - 1 and the columns are numbered ___ | 0 to COLUMN_SIZE - 1 |
If matrix is a two-dimensional array, then the ___ address of matrix is the address of the array component matrix [0][0] | base |