Loading practice questions
Is the destruction of temporary object safe (while returning object)?
Correct Answer: C — No, unexpected side effects may occur
Explanation:
The destruction of temporary variable may give rise to unexpected logical errors. Consider the destructor which may free the dynamically allocated memory. But this may abort the program if another is still trying to copy the values from that dynamic memory.