Exercise: Constructors And Destructors

Questions for: Constructors And Destructors

__________ used to make a copy of one class object from another class object of the same class type.
A:
constructor
B:
copy constructor
C:
destructor
D:
default constructor
Answer: B
No answer description is available. Let's discuss.
Which of the following gets called when an object goes out of scope?
A:
constructor
B:
destructor
C:
main
D:
virtual function
Answer: B
No answer description is available. Let's discuss.
A union that has no constructor can be initialized with another union of __________ type.
A:
different
B:
same
C:
virtual
D:
class
Answer: B
No answer description is available. Let's discuss.
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
A:
constructor
B:
destructor
C:
function
D:
object
Answer: B
No answer description is available. Let's discuss.
Copy constructor must receive its arguments by __________ .
A:
either pass-by-value or pass-by-reference
B:
only pass-by-value
C:
only pass-by-reference
D:
only pass by address
Answer: C
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz