Exam 13: Overloading and Templates

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

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

Free
(Short Answer)
4.9/5
(30)
Correct Answer:
Verified

operator

In C++, operator is a reserved word.

Free
(True/False)
4.7/5
(30)
Correct Answer:
Verified

True

Class templates are called ____ types.

Free
(Multiple Choice)
4.9/5
(35)
Correct Answer:
Verified

D

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

If you overload the binary arithmetic operator + as a member function, how many objects must be passed as parameters?

(Multiple Choice)
4.9/5
(39)

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

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

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.7/5
(32)

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

The function that overloads the ____ operator for a class must be declared as a member of the class.

(Multiple Choice)
4.9/5
(38)

The ____________________ operator causes a member-wise copy of the member variables of the class.

(Short Answer)
5.0/5
(34)

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

(Short Answer)
4.9/5
(52)

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

(True/False)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(41)

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

(True/False)
4.8/5
(35)

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

When writing the definition of a friend function, the name of the class and the scope resolution operator precede the name of the friend function in the function heading.

(True/False)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(38)

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
(37)
Showing 1 - 20 of 41
close modal

Filters

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