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 public and private data members?
State the difference between delete and delete[].
Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.
Is it possible to provide special behavior for one instance of a template but not for other instances?
Difference between class and structure.
Explain 'this' pointer and what would happen if a pointer is deleted twice?
how many controls can we place on single form.
implement stack using stack.h headerfile functions
1 Answers Exilant, GMG, Subex, University,
Briefly describe a B+ tree. What is bulk loading in it?
What is a rooted hierarchy?
What is the basic structure of c++ program?
What is a literal in c++?