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

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

Consider the following declaration of a struct: struct studentType { \quad char name[26]; \quad double gpa; \quad int sID; \quad 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:
Verified

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

value

In C++, the member access operator arrow is >>.

Free
(True/False)
4.9/5
(38)
Correct Answer:
Verified

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 the statement int* p, q; p and q are pointer variables.

(True/False)
4.9/5
(43)

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)

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

(Multiple Choice)
4.9/5
(34)

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 C++ operator ____ is used to create dynamic variables.

(Multiple Choice)
4.7/5
(40)

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)

Run-time binding is also known as ____ binding.

(Multiple Choice)
4.9/5
(30)

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

Filters

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