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
(80)
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)
4.9/5
(82)
Correct Answer:
Verified

True

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

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

False

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

(Short Answer)
4.7/5
(66)

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

(Multiple Choice)
4.7/5
(87)

A pointer variable is a variable whose content is a memory address.

(True/False)
4.9/5
(90)

Which of the following can be used to initialize a pointer variable?

(Multiple Choice)
4.8/5
(86)

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
(85)

In C++,the dot operator has a lower precedence than the dereferencing operator.

(True/False)
4.7/5
(80)

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
(91)

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
(74)

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

(Multiple Choice)
4.8/5
(88)

Once a class contains one or more pure virtual functions,then that class is called a(n)____________________ class.

(Short Answer)
4.7/5
(73)

In C++,you declare a pointer variable by using the ____ symbol.

(Multiple Choice)
4.8/5
(74)

If p is a pointer variable,the statement p = p + 1; is valid in C++.

(True/False)
5.0/5
(71)

The ____ operator can be used to return the address of a private data member of a class.

(Multiple Choice)
4.9/5
(86)

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
(80)

Which of the following operations is allowed on pointer variables?

(Multiple Choice)
4.8/5
(74)

A memory leak is an unused memory space that cannot be allocated.

(True/False)
4.9/5
(71)

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
(89)
Showing 1 - 20 of 50
close modal

Filters

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