I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
No Answer is Posted For this Question
Be the First to Post Answer
what is scupper?
How to reduce a final size of executable?
How to construct muliton object
What are friend classes? What are advantages of using friend classes?
Difference between linked list and array?
what is pulse code modulation?
What is the main purpose of c++?
What is the size of integer variable?
what is data abstraction in C++?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
What is a local variable?
Is it possible to provide special behavior for one instance of a template but not for other instances?