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 a typedef for IntPtr defines a pointer to an integer,what would be the correct declaration for a function that expects a reference to an integer pointer?
Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
A
The size of a dynamic array is defined at ___________
Free
(Short Answer)
4.9/5
(40)
Correct Answer:
run-time
If p1 is an integer pointer variable,with the value of 1000,p1++ changes P1 to point to the memory location 1001.
Free
(True/False)
4.9/5
(42)
Correct Answer:
False
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
(39)
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.8/5
(39)
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.8/5
(40)
In the following statement,all the variables are pointers.
int* p1,p2;
(True/False)
4.7/5
(38)
Given that p1 is a pointer variable of the string class,which of the following are legal statements?
(Multiple Choice)
4.8/5
(38)
Which of the following correctly declares a user-defined data type that defines a pointer to a float?
(Multiple Choice)
4.8/5
(30)
What is the output of the following code fragment?
Float *p1;
P1 = new float3);
Cout << *p1;
(Multiple Choice)
5.0/5
(27)
What is the output of the following code?
Int *p1,*p2;
P1 = new int;
P2 = new int;
*p1=11;
*p2=0;
P2=p1;
Cout << *p1 <<" " << *p2 << endl;
(Multiple Choice)
4.9/5
(31)
Write the code to return the dynamic memory pointed to by p1 to the freestore.
(Short Answer)
4.8/5
(34)
Which of the following assigns to p1 the pointer to the address of value?
(Multiple Choice)
4.9/5
(25)
Write the code to declare a dynamic array of strings use the string pointer variable p1)that has as many elements as the variable arraySize.
(Short Answer)
5.0/5
(40)
If two pointer variables point to the same memory location,what happens when one of the pointers is freed?
(Multiple Choice)
4.7/5
(30)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)