Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 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 (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
In a(n)____ copy,two or more pointers have their own data.
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
B
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.
Free
(True/False)
5.0/5
(41)
Correct Answer:
True
In the statement
int* p,q;
p and q are pointer variables.
Free
(True/False)
4.8/5
(42)
Correct Answer:
False
The ____________________ of a base class automatically makes the destructor of a derived class virtual.
(Short Answer)
4.7/5
(33)
A pointer variable is a variable whose content is a memory address.
(True/False)
4.9/5
(42)
Which of the following can be used to initialize a pointer variable?
(Multiple Choice)
4.8/5
(36)
The dereferencing operator is also known as the indirection operator and refers to the object to which its operand points.
(True/False)
4.9/5
(39)
In C++,the dot operator has a lower precedence than the dereferencing operator.
(True/False)
4.8/5
(44)
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
(42)
Consider the following statements:
int x;
int &y = x;
The second statement declares y to be a(n)____________________ of x.
(Short Answer)
4.9/5
(32)
Once a class contains one or more pure virtual functions,then that class is called a(n)____________________ class.
(Short Answer)
4.7/5
(37)
In C++,you declare a pointer variable by using the ____ symbol.
(Multiple Choice)
4.8/5
(35)
If p is a pointer variable,the statement p = p + 1; is valid in C++.
(True/False)
4.9/5
(27)
The ____ operator can be used to return the address of a private data member of a class.
(Multiple Choice)
4.9/5
(41)
Consider the following statements:
void pointerParameters(int* &p,double *q)
{
.
.
.
}
In the function pointerParameters,the parameter q is a(n)____________________ parameter.
(Short Answer)
4.8/5
(30)
Which of the following operations is allowed on pointer variables?
(Multiple Choice)
4.8/5
(34)
A memory leak is an unused memory space that cannot be allocated.
(True/False)
4.8/5
(34)
What is the output of the following code?
int *p;
Int x;
x = 12;
p = &x;
cout << x << ",";
*p = 81;
Cout << *p << endl;
(Multiple Choice)
4.9/5
(38)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)