Exam 13: Overloading and Templates

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

Which of the following function prototypes overloads the != operator for the class rectangleType?

(Multiple Choice)
4.8/5
(44)

Every object of a class maintains a (hidden) pointer to itself, and the name of this pointer is ____.

(Multiple Choice)
4.9/5
(33)

Which of the following is the general syntax of the function prototype to overload the pre-increment operator as a nonmember function?

(Multiple Choice)
4.8/5
(38)

The return type of the function operator == is ____.

(Multiple Choice)
5.0/5
(41)

The general syntax to overload the stream extraction operator >> for a class is ____.

(Multiple Choice)
4.9/5
(43)

In C++, >> is used as a stream extraction operator and as a right shift operator.

(True/False)
4.8/5
(40)

Which of the following is the general syntax of the function prototype to overload the post-increment operator as a member function?

(Multiple Choice)
4.8/5
(32)

Operators can be overloaded either for objects of the user-defined types, or for a combination of objects of the user-defined type and objects of the built-in type.

(True/False)
4.9/5
(34)

Which of the following is the syntax to declare the operator function operator[] as a member function of a class for constant arrays?

(Multiple Choice)
4.9/5
(34)

The operators that cannot be overloaded are ., .*, ::, ?:, and ____________________.

(Short Answer)
4.9/5
(31)

Suppose cType is a class template, which can take int as a parameter. The statement: ____ declares x to be an object of type cType, and the type passed to the class cType is int.

(Multiple Choice)
4.8/5
(35)

A class template is called a(n) ____________________ type because it specifies how a generic class template is to be customized to form a specific template class.

(Short Answer)
4.8/5
(43)

The ____________________ members of a class are local to the class and, therefore, cannot be accessed outside of the class.

(Short Answer)
4.9/5
(37)

To overload the pre-increment (++) operator for a class, if the operator function is a member of that class, it must have ____ parameter(s).

(Multiple Choice)
4.9/5
(29)

Operator functions typically return void.

(True/False)
5.0/5
(30)

A(n) ____ function is a nonmember function that has access to all members of the class.

(Multiple Choice)
4.8/5
(46)

Most operator functions can either be member functions or nonmember functions of a class.

(True/False)
4.9/5
(36)

Which of the following is a built-in operation on classes?

(Multiple Choice)
4.8/5
(36)

The ____________________ operator function as a member of a class has only one parameter; as a nonmember of a class, it has two parameters.

(Short Answer)
4.8/5
(43)

With the exception of the ____________________ operator and the member selection operator, operators must be overloaded to be used on class objects.

(Short Answer)
4.8/5
(47)
Showing 21 - 40 of 50
close modal

Filters

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