Exam 11: Friends, overloaded Operators, and Arrays in Classes
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
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)
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)
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)
Showing 21 - 40 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)