Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

In a(n)____ copy,two or more pointers have their own data.

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

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:
Verified

True

In the statement int* p,q; p and q are pointer variables.

Free
(True/False)
4.8/5
(42)
Correct Answer:
Verified

False

The ____________________ of a base class automatically makes the destructor of a derived class virtual.

(Short Answer)
4.7/5
(33)

In C++,____ is called the address of operator.

(Multiple Choice)
4.8/5
(44)

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)

The code int *p; declares p to be a(n)____ variable.

(Multiple Choice)
4.8/5
(40)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)