Shall we use 'free' to free memory assigned by new, What are
the further consequences??
Answer Posted / aruna kumar samal
yes you can use free to free memory assignrd by new but it
wo not call the destructor.
|Is This Answer Correct ?||6 Yes||0 No|
What is struct c++?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What is guard code in c++?
Why was c++ made?
What is c++ manipulator?
What is the use of endl in c++ give an example?
What is a down cast?
Explain the isa and hasa class relationships. How would you implement each?
What is the use of structure in c++?
Differentiate between an inspector and a mutator ?
What is the use of function pointer?
What is a map in c++?
Is c++ an integer?
What is the difference between equal to (==) and assignment operator (=)?
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.