Exam 11: Friends, overloaded Operators, and Arrays in Classes

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Both the copy constructor and the assignment operator should make ___________

(Essay)
4.8/5
(38)

Why are the extraction and insertion operators always implemented as friends of the class rather than as members of the class?

(Multiple Choice)
4.9/5
(43)

Operators must be friends of the class.

(True/False)
4.8/5
(36)

An overloaded extraction or insertion operator should return ___________

(Short Answer)
4.8/5
(43)

If a given task being performed by a function involves one object,then that function should normally be a __________ function.

(Short Answer)
4.8/5
(37)

Which of the following are valid declarations for an assignment operator for a class named myClass?

(Multiple Choice)
5.0/5
(29)

In order to do automatic type conversion for your class,you would write _________

(Essay)
4.7/5
(32)

Which of the following would be an appropriate function declaration to add two rational numbers?

(Multiple Choice)
4.9/5
(42)

An operator that expects two parameters is called a ________ operator.

(Short Answer)
4.7/5
(32)

What is wrong with the following overloaded extraction operator declaration? Istream& operator >>istream& in,const myClass &object);

(Multiple Choice)
4.9/5
(31)

What happens when you define a class that used dynamic memory allocation and define a destructor but no copy constructor?

(Multiple Choice)
4.8/5
(28)

If a given task being performed by a function involves more than one object,then that function should normally be a __________ function.

(Short Answer)
4.8/5
(39)

Putting the keyword const after the function declaration guarantees __________________________

(Essay)
4.9/5
(46)

In the following code fragment,which is the calling object for the less-than operator? String s1,s2; If s1 < s2 )

(Multiple Choice)
4.8/5
(42)

When a dynamic array with a class for a base type is declared,which constructor is called?

(Multiple Choice)
4.8/5
(36)

Given the following function declaration, Friend void displayconst myClass& object); Which is the correct header for the definition of the function?

(Multiple Choice)
4.9/5
(34)

Friend functions are members of the class.

(True/False)
4.9/5
(34)

If obj1 and obj2 are both objects of a class that uses dynamic memory allocation,but the class does not have an assignment operator,what happens if you execute the following code? Obj1=obj2;

(Multiple Choice)
4.8/5
(42)

Write the function declaration for a copy constructor for a class named myClass

(Short Answer)
4.8/5
(30)

Which of the following statements are true?

(Multiple Choice)
4.8/5
(36)
Showing 21 - 40 of 49
close modal

Filters

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