Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
20 Cards in this Set
- Front
- Back
All components within the same array are of the same type.
|
true
|
|
In C++, what is the array subscripting operator?
|
[ ]
|
|
In C++, what is the array starting index?
|
0
|
|
It is the programmer's responsibility to make sure that the index is within bounds.
|
true
|
|
Arrays as parameters to functions are passed by reference only.
|
true
|
|
The following code is legal,
int list1[5] = {3, 0, 7, 8, 1}; int list2[5]; list2 = list1; |
false
review p. 349 on how to copy an array |
|
When declaring a one-dimensional array as a formal parameter, the size of the array must be specified within square brackets.
|
false
void myArrayFunction(int myList[ ]) |
|
The word const is used before the array declaration in a function heading to prevent the function from modifying the array.
|
true
Remember, the array is passed by reference to a function and changing the array in the function will change the original array. void myArrayFunction(int myList1[ ], const int myList2[ ]) Here, myList2 will not be changed. |
|
The base address of an array is the memory location of the first array component.
|
true
|
|
When you pass an array as a parameter, the base address of the actual array is passed to the formal parameter.
|
true
|
|
The declaration char myArray[21] = "Hello world"; declares myArray to be an array of unspecified length.
|
false
|
|
What value does the strcmp function return if both values are the same?
|
0
|
|
Which string function would you use to return the length of the string myStr?
|
strlen(myStr)
|
|
The following statements creates myArray to be a two-dimensional array of 25 rows and 10 columns.
int myArray[10][25]; |
false
|
|
In row processing, a two-dimensional array is processed one row at a time.
|
true
|
|
When a two-dimensional array is declared as a formal parameter, the C++ compiler ignores the sizes of both dimensions.
|
false
Review p. 374 |
|
How would you declare an integer array called, myArray, with 25 values?
|
int myArray[25];
|
|
Assume you have the following declaration char myList[100];. Which of the following ranges is valid for the index of the array myList?
|
0 - 99
|
|
In C++, how do you represent the null character?
|
'\0'
|
|
Declare a 10 component integer array called, myArray, and initialize all the components to 0.
|
int myArray[10] = {0};
|