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.
What size is allocated to the union variable?
What C++ libraries are you proficient with?
Explain stack & heap objects?
What are enumerations?
What are the total number of lines written by you in C/C++? What is the most complicated or valuable program written in C/C++?
What is function overloading in C++?
When is a template better solution than a base class??
Why do we use setw in c++?
Is c++ the best programming language?
How many namespaces are there in c++?
What is the sequence of destruction of local objects?
What is conditions when using boolean operators?