What is a dangling pointer?
Answers were Sorted based on User's Feedback
Answer / sumithra.a
A dangling pointer arises when you use the address of an
object after its lifetime is over. This may occur in
situations like returning addresses of the automatic
variables from a function or using the address of the
memory block after it is freed
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / achal ubbott
Here is an example of dangling pointer.
char* p = new char;// allocate a byte from heap section.
delete p ; // deallocation.
*p = 44 ; // using a dangling pointer.
| Is This Answer Correct ? | 8 Yes | 0 No |
In c++, what is the difference between method overloading and method overriding?
In a function declaration, what does extern mean?
string somestring ; Which of the following choices will convert a standard C++ string object "somestring" to a C string? a) Copy.somestring () ; b) somestring.c_str () c) &somestring [1] d) std::cstring (somestring) e) (char *) somestring
Types of storage and scope of each type
How do you declare A pointer to function which receives an int pointer and returns a float pointer
Write a C++ Program to Multiply two Numbers
what is the difference between overloading & overriding? give example.
What is static class data?
What is an adaptor class in c++?
What is a mutable member?
What is bubble sort c++?
please help to write the code of chess game in c++??????????