Exam 13: Operator Overloading and Templates

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

Class templates are called ____ types.

(Multiple Choice)
4.8/5
(95)

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

(Multiple Choice)
4.8/5
(79)

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

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

Operator functions typically return void.

(True/False)
4.8/5
(80)

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

(Multiple Choice)
4.8/5
(78)

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

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

(True/False)
4.7/5
(87)

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

(Short Answer)
4.8/5
(78)

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

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

(Multiple Choice)
4.9/5
(81)

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

(Multiple Choice)
5.0/5
(68)

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

(Short Answer)
4.9/5
(70)

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

(Multiple Choice)
4.7/5
(87)

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

(Multiple Choice)
4.9/5
(83)

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

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

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

(Multiple Choice)
4.8/5
(80)

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

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

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

Filters

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