Exam 14: More About Classes

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

To overload the + operator, you would write a function named

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

B

A non-static member function may not access a static member variable.

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

False

It is possible to declare an entire class as a friend of another class.

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

True

A static member function does not need to be called by a specific object of the class.

(True/False)
4.8/5
(27)

When a class declares an entire class as its friend, the friendship status is reciprocal. That is, each class's member functions have free access to the other's private members.

(True/False)
4.9/5
(35)

When you redefine the way a standard operator works when it is used with class objects, you have __________ the operator.

(Multiple Choice)
4.9/5
(36)

A move operation transfers resources from a source object to a target object.

(True/False)
4.9/5
(39)

A public data member may be declared a friend of a private function.

(True/False)
4.9/5
(37)

A(n) __________ is a special function that is called whenever a new object is created and initialized with another object's data.

(Multiple Choice)
4.8/5
(32)

In C++11 an rvalue reference is a reference variable that can refer only to temporary objects.

(True/False)
4.7/5
(37)

Select all that apply. Given the following code fragment, which of the things shown below happen when the statement on line 8 executes? 1 int square(int a) 2 { 3 \quad return a * a; 4 } 5 int main() 6 { 7 \quad int x = 0; 8 \quad x = square(5); 9 \quad cout << x << endl; 10 \quad return 0; 11 }

(Multiple Choice)
4.9/5
(33)

An ___________ operator can work with programmer-defined data types.

(Multiple Choice)
4.9/5
(32)

A static member variable can be used when there are no objects of the class in existence.

(True/False)
4.7/5
(48)

The this pointer is a special built-in pointer that is automatically passed as a hidden argument to all non-static member functions.

(True/False)
4.8/5
(29)

Which type of function is not a member of a class but has access to the private members of the class?

(Multiple Choice)
5.0/5
(33)

A(n) __________ informs the compiler that a class will be declared later in the program.

(Multiple Choice)
4.9/5
(29)

A member function that is declared __________ may not access any non-static data members in the class.

(Multiple Choice)
4.7/5
(37)

If you do not furnish a __________, a default one will be provided by the compiler.

(Multiple Choice)
4.8/5
(30)

A good reason to overload an operator is to enable it to

(Multiple Choice)
4.7/5
(36)

In C++11 reference variables that can refer only to temporary objects that would otherwise have no name are called __________ and are declared with a __________.

(Multiple Choice)
4.8/5
(34)
Showing 1 - 20 of 46
close modal

Filters

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