Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
Consider the following declaration of a struct:
struct studentType
{
char name[26];
double gpa;
int sID;
char grade;
};
studentType student;
studentType *studentPtr;
The statement (*studentPtr).gpa = 2.5; is equivalent to ___________________ = 2.5;.
Free
(Short Answer)
4.7/5
(43)
Correct Answer:
studentPtr-->gpa
The copy constructor automatically executes when, as a parameter, an object is passed by ____________________.
Free
(Short Answer)
4.8/5
(34)
Correct Answer:
value
In C++, the member access operator arrow is >>.
Free
(True/False)
4.9/5
(38)
Correct Answer:
False
In C++, pointer variables are declared using the reserved word pointer.
(True/False)
4.9/5
(40)
Consider the following statements:
void pointerParameters(int* &p, double *q)
{
.
.
.
}
In the function pointerParameters, the parameter p is a(n) ____________________ parameter.
(Short Answer)
4.8/5
(43)
An array created during the execution of a program is called a(n) ____ array.
(Multiple Choice)
4.8/5
(44)
A class ____ automatically executes whenever a class object goes out of scope.
(Multiple Choice)
4.8/5
(37)
In a ____ copy, two or more pointers of the same type point to the same memory.
(Multiple Choice)
4.8/5
(36)
Given the declaration int *a;, the statement a = new int[50]; dynamically allocates an array of 50 components of the type ____.
(Multiple Choice)
4.8/5
(41)
Which of the following arithmetic operations is allowed on pointer variables?
(Multiple Choice)
4.8/5
(33)
A memory leak is an unused memory space that cannot be allocated.
(True/False)
4.8/5
(39)
The binding of virtual functions occurs at program ____________________ time.
(Short Answer)
4.8/5
(43)
The statement that declares board to be a pointer to a pointer is: int ____________________;
(Short Answer)
4.9/5
(36)
Given the declaration
int *p;
The statement
p = new int[50];
dynamically allocates an array of 50 components of type int and p contains the base address of the array.
(True/False)
4.7/5
(40)
Consider the following statement: ptrMemberVarType objectThree(objectOne);
The values of the member variables of objectOne are being copied into the corresponding member variables of objectThree. This initialization is called the ____.
(Multiple Choice)
4.7/5
(44)
Which of the following can be used to initialize a pointer variable?
(Multiple Choice)
4.8/5
(36)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)