Exam 9: Pointers and Dynamic Arrays
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
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
(34)
Write the code that assigns to p1 an integer pointer variable)the pointer to a dynamically created integer.
(Short Answer)
4.8/5
(39)
Which of the following statements correctly prints out the value that is in the memory address that the pointer p1 is pointing to?
(Multiple Choice)
4.8/5
(49)
Assuming that the pointer variable p1 is of the correct type and size is an integer with some value > 1,which of the following declarations are legal?
(Multiple Choice)
4.9/5
(45)
When you return a dynamic array to the freestore,you must include the number of elements in the array.
(True/False)
4.8/5
(40)
Even though pointers point to addresses which are integers,you can not assign an integer to a pointer variable.
(True/False)
4.8/5
(39)
In the statement cout << *p1;,the * is called the ________________
(Short Answer)
4.8/5
(28)
If p1 is an integer pointer that is pointing to memory location 1001,and an integer takes 4 bytes,then p1+1)evaluates to:
(Multiple Choice)
4.8/5
(45)
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.8/5
(37)
Which of the following correctly declare 3 integer pointers?
(Multiple Choice)
4.8/5
(36)
If a program requires a dynamically allocate two-dimensional array,you would allocate the memory by using
(Multiple Choice)
4.7/5
(33)
Which of the following correctly declares a dynamic array of strings?
(Multiple Choice)
4.9/5
(38)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)