Exam 9: Pointers and Dynamic Arrays
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
Which of the following correctly declare 3 integer pointers?
(Multiple Choice)
4.8/5
(37)
Which of the following statements correctly returns the memory from the dynamic array pointer to by p1 to the freestore?
(Multiple Choice)
4.8/5
(34)
If p1 is an integer pointer variable, with the value of 1000, p1++ changes P1 to point to the memory location 1001.
(True/False)
4.7/5
(36)
Write the code that assigns to p1 an integer pointer variable) the pointer to a dynamically created integer.
(Short Answer)
4.9/5
(40)
If p1 and p2 are both pointers that point to integers in memory, the condition p1==p2 will be true if the values that are in those memory locations are the same.
(True/False)
4.9/5
(42)
In the statement cout << *p1;, the * is called the ________________
(Short Answer)
4.8/5
(30)
Given that p1 is an integer pointer variable, and a1 is an integer array, which of the following statements are not legal code?
(Multiple Choice)
4.8/5
(32)
What is wrong with the following code fragment?
Int *p1, *p2;
P1 = new int;
P2 = new int;
*p1=11;
*p2=0;
P2=p1;
Cout << *p1 <<" " << *p2 << endl;
Delete p1;
Delete p2;
(Multiple Choice)
4.7/5
(31)
What is the output of the following code fragment?
Int v1=2, v2=-1, *p1, *p2;
P1 = & v1;
P2= & v2;
P2=p1;
Cout << *p2 << endl;
(Multiple Choice)
4.9/5
(37)
If two pointer variables point to the same memory location, what happens when one of the pointers is freed?
(Multiple Choice)
4.9/5
(30)
Which of the following correctly declares a dynamic array of strings?
(Multiple Choice)
4.9/5
(31)
Showing 21 - 39 of 39
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)