Computer Science, asked by mawraakbar99, 4 months ago

Quiz: Final Paper
Course:CSI-302
What happens when an object is passed by reference
01)
Destructor is called when called explicitly
O2)
Destructor is called at end of function
03)
Destructor is not called
04)
Destructor is called when function is out of scope​

Answers

Answered by medha6932
0

Answer:

1-The location of the object, that is, the exact memory location is passed, when the object is passed by reference.

2-Destructors are called when one of the following events occurs: A local (automatic) object with block scope goes out of scope. An object allocated using the new operator is explicitly deallocated using delete .

3-The destructor, and hence statement A, is executed as part of the processing of the return 0 statement B. This is a simple guarantee in C++, that the destructor of a local object with automatic storage, is executed automatically when the execution leaves the object's scope.

Similar questions