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
Is python written in c or c++?
What is the latest version on c++?
Which function cannot be overloaded c++?
What is a local reference?
What is vector pair in c++?
Difference between overloading vs. Overriding
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What are static and dynamic type checking?
How would you implement a substr() function that extracts a sub string from a given string?
What are the 2 main types of data structures?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
What will happen if when say delete this ?