Exam 11: Arrays, Addresses, and Pointers
Exam 1: Introduction to Computer Programming44 Questions
Exam 2: Getting Started in C Programming46 Questions
Exam 3: Processing and Interactive Input48 Questions
Exam 4: Selection44 Questions
Exam 5: Repetition47 Questions
Exam 6: Modularity Using Functions: Part I51 Questions
Exam 7: Modularity Using Functions: Part II49 Questions
Exam 8: Arrays48 Questions
Exam 9: Character Strings51 Questions
Exam 10: Data Files50 Questions
Exam 11: Arrays, Addresses, and Pointers49 Questions
Exam 12: Structures48 Questions
Exam 13: Dynamic Data Structures49 Questions
Exam 14: Additional Capabilities55 Questions
Exam 15: A Brief Introduction to C++49 Questions
Select questions type
Access to an array using a subscript can always be replaced by an equivalent access using the array name as a pointer.
(True/False)
4.7/5
(48)
You can replace lines 5 and 6 in the following function with ____.
1 /* copy string2 to string1 */
2 void strcopy(char string1[], char string2[])
3 {
4 int i = 0;
5 while (string1[i] = string2[i])
6 i++;
7 }
(Multiple Choice)
4.8/5
(33)
The following code is valid in C:
char *message;
strcpy(message,"abcdef");
(True/False)
4.9/5
(34)
A suitable equivalent to the function header calc(int pt[2][3]) is ____.
(Multiple Choice)
4.9/5
(36)
When working with pointers, the ____ tells the number of variables that are to be skipped over.
(Multiple Choice)
4.9/5
(26)
After creating two variables as follows:
Char message1[81] = "this is a string";
Char *message2 = "this is a string";
The statement ____ is not valid in C.
(Multiple Choice)
4.8/5
(39)
One advantage of using subscripts for array processing is that they are more efficient than using pointers directly.
(True/False)
4.8/5
(41)
The address stored in the array name cannot be changed by an assignment statement.
(True/False)
4.9/5
(42)
When adding or subtracting numbers to pointers, the computer automatically adjusts the number to ensure that the result still "points to" a value of the original data type.
(True/False)
4.9/5
(48)
In performing ____ on pointers, we must be careful to produce addresses that point to something meaningful.
(Multiple Choice)
4.8/5
(39)
The addresses in pointers can be compared using any of the relational operators (==, !=, <, >, etc.) that are valid for comparing other variables.
(True/False)
4.8/5
(42)
A pointer access can sometimes (but not always) be replaced using subscript notation.
(True/False)
4.9/5
(37)
If we store the address of grade[0] in a pointer named gPtr (using the assignment statement gPtr = &grade[0];), then, the expression ____ references grade[0].
(Multiple Choice)
4.9/5
(33)
Pointers, both as variables and function parameters, are used to store addresses.
(True/False)
4.8/5
(49)
Instead of initially creating a string as an array it is possible to create a string using a pointer.
(True/False)
4.7/5
(33)
Showing 21 - 40 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)