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
in C++ , the word plus plus who found this?
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
How do I run a program in notepad ++?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
Explain linear search.
How to defines the function in c++?
What is meaning of in c++?
Is it possible to use a new for the reallocation of pointers ?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
What does flush do c++?
Can member functions be private?
Differentiate between a template class and class template?