Exam 13: Overloading and Templates

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

When an object invokes a member function, the member function references the pointer ____ of the object.

(Multiple Choice)
4.8/5
(43)

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

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

(Short Answer)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(36)

To include the operator function operator+ as a nonmember function of the class rectangleType, its prototype in the definition of rectangleType is: ____ rectangleType operator+(const rectangleType&, const rectangleType&);

(Multiple Choice)
4.8/5
(32)

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

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.7/5
(36)

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

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.7/5
(40)

The general syntax for the function prototype to overload the assignment operator = for a class is ____.

(Multiple Choice)
4.8/5
(42)

The associativity of the operator = is from right to left.

(True/False)
4.9/5
(45)

A(n) ____________________ constructor converts its argument to an object of the constructor's class.

(Short Answer)
4.9/5
(50)

The declaration of a friend function cannot be placed within the private part of the class.

(True/False)
4.8/5
(30)

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

(True/False)
4.9/5
(43)

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

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

Operator functions typically return void.

(True/False)
4.9/5
(37)

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

(Multiple Choice)
4.8/5
(31)

The only built-in operations on classes are assignment (=) and ____________________.

(Short Answer)
4.7/5
(46)
Showing 21 - 40 of 41
close modal

Filters

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