Exam 13: Operator Overloading and Templates

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

Class templates are called ____ types.

(Multiple Choice)
4.9/5
(41)

The name of the function to overload the operator <= is ____.

(Multiple Choice)
4.8/5
(30)

When the post-increment operator is overloaded as a nonmember function of the class, the operator function has ____ parameter(s).

(Multiple Choice)
4.9/5
(32)

Suppose cType is a class template, and func is a member function of cType.The heading of the function definition of func is: ____.

(Multiple Choice)
4.9/5
(38)

Operator functions typically return void.

(True/False)
4.8/5
(36)

Using a class template, you can write a single code segment for a set of related ____.

(Multiple Choice)
4.8/5
(32)

The general form of the functions to overload the binary operators as member functions of a class is returnType operator#(____ className&) const;.

(Multiple Choice)
4.8/5
(30)

A friend function does not have access to the private data members of the class.

(True/False)
4.7/5
(42)

Any function that overloads an operator is called a(n) ____________________ function.

(Short Answer)
4.8/5
(38)

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

The return type of the function to overload the operator >> must be a reference to a(n) ____ object.

(Multiple Choice)
4.9/5
(40)

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

(Multiple Choice)
4.9/5
(26)

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

(Short Answer)
4.9/5
(31)

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

(Multiple Choice)
4.7/5
(34)

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

(Multiple Choice)
4.9/5
(41)

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.9/5
(38)

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

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

(Multiple Choice)
4.9/5
(40)

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.9/5
(35)

Both parameters of the function to overload the operator << are reference parameters.

(True/False)
4.8/5
(45)
Showing 21 - 40 of 41
close modal

Filters

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