Explain why you must be careful when passing object to a function or returning objects from a function in a program.

      

Explain why you must be careful when passing objects to a function or returning objects from a function in a program.

  

Answers


Davis
Temporary copies of the objects are created that will be destroyed when the function terminates.When a temporary copy of an object is destroyed, the destructor function might destroy something needed elsewhere in the program.
Githiari answered the question on February 4, 2018 at 11:09


Next: Can the address of an object in a program be passed to a function as an argument?
Previous: What is a friend function in a computer program?

View More Computer Science Questions and Answers | Return to Questions Index


Exams With Marking Schemes

Related Questions