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 the difference between static link library and dynamic link library?
Hi i need to Acess a variable "int Intval" in the below mentioned code .How to Access it guys i am waiting for your reply
Do we have private destructors?
What is the use of seekg in c++?
Why do we use classes in programming?
Is map ordered c++?
What is protected inheritance?
What are the four partitions in which c++ compiler divides the ram?
What are c++ stream classes?
daily Routine of father
What happens when a function throws an exception that was not specified by an exception specification for this function?
What is the difference between Pointer and a Reference? When you would use them?