1.

Which type of program is recommended to include in try block?(a) static memory allocation(b) dynamic memory allocation(c) const reference(d) pointerI had been asked this question in an online interview.The origin of the question is Exceptions That Are Not Errors topic in section Derived Classes, Templates & Exception Handling in C++ of C++

Answer»

The correct ANSWER is (B) dynamic memory allocation

The explanation: While during dynamic memory allocation, Your system may not have sufficient resources to handle it, So it is better to USE it INSIDE the try block.



Discussion

No Comment Found

Related InterviewSolutions