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

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

What is the value of x after the following statements execute? int x = 25; Int *p; P = &x; *p = 46;

(Multiple Choice)
4.8/5
(40)

What is the output of the following code? int *p; int x; x = 76; p = &x; *p = 43; cout << x << "," << *p << endl;

(Multiple Choice)
4.8/5
(41)

A list is a collection of elements of the same type.

(True/False)
4.8/5
(32)

Which of the following arithmetic operations is allowed on pointer variables?

(Multiple Choice)
4.9/5
(34)

An array created during the execution of a program is called a(n)____ array.

(Multiple Choice)
4.8/5
(39)

Variables that are created during program execution are called static variables.

(True/False)
4.8/5
(35)

The C++ operator ____ is used to destroy dynamic variables.

(Multiple Choice)
4.9/5
(35)

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.8/5
(43)

The statement int *p; is equivalent to int * p;,which is also equivalent to the statement ____________________.

(Short Answer)
4.9/5
(39)

An object of the base class type cannot be passed to a(n)____________________ parameter of the derived class type.

(Short Answer)
4.8/5
(37)

The copy constructor automatically executes when,as a parameter,an object is passed by ____________________.

(Short Answer)
5.0/5
(38)

Given the statement double *p;,the statement p++; will increment the value of p by ____ byte(s).

(Multiple Choice)
4.9/5
(40)

A(n)____ is a collection of distinct elements of the same type.

(Multiple Choice)
4.9/5
(38)

The statement that declares board to be a pointer to a pointer is: int ____________________;

(Short Answer)
4.9/5
(42)

For classes with pointer member variables,you should include the copy constructor and the ____________________ in the class.

(Short Answer)
4.9/5
(43)

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

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;.

(Short Answer)
4.8/5
(44)

In C++,pointer variables are declared using the reserved word pointer.

(True/False)
4.8/5
(30)

Run-time binding is also known as ____ binding.

(Multiple Choice)
4.8/5
(34)

Which of the following would be appropriate syntax for the heading of a copy constructor for a class called rulerType?

(Multiple Choice)
4.8/5
(36)
Showing 21 - 40 of 50
close modal

Filters

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