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 size of integer variable?
What are all predefined data types in c++?
Compare compile time polymorphism and Runtime polymorphism
What is a map in c++?
What is the extraction operator and what does it do?
Which is the best c++ compiler?
int *p = NULL; printf("%1d",p) ; what will be the output of this above code?
What is singleton pattern in c++?
What is the best c++ book for beginners?
What is iterator in c++?
What happens when a function throws an exception that was not specified by an exception specification for this function?
What is general format for a prototype?