When an object is returned___________

Mỹ An

New member
When an object is returned___________
A. A temporary object is created to return the value
B. The same object used in function is used to return the value
C. The Object can be returned without creation of temporary object
D. Object are returned implicitly, we can’t say how it happens inside program
 
Answer: a
Explanation: A temporary object is created to return the value. It is created because the object used in function is destroyed as soon as the function is returned. The temporary variable returns the value and then gets destroyed.
 

Tìm kiếm

Back
Top