MCQs > IT & Programming > C++ > This code: template void Kill(T *&objPtr) { delete objPtr; objPtr = NULL; } class MyClass { }; void Test() { MyClass *ptr = new MyClass(); Kill(ptr); Kill(ptr); } Invoking Test() will cause which of the following?

C++ MCQs

Consider the following code: <font size=2> template<class T> void Kill(T *&objPtr) { delete

objPtr; objPtr = NULL; } class MyClass { }; void Test() { MyClass *ptr = new MyClass();

Kill(ptr); Kill(ptr); } </font> Invoking Test() will cause which of the following? 

Answer

Correct Answer: Code will execute properly

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it