Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
What is a Dangling Pointer?
Posted By :
Posted Date :
March 29, 2010
If a pointer's memory has deallocated by the application means it can be crashed. This kind of situation is called as Dangling Pointers.
You can also find related Interview Question to
What is a Dangling Pointer?
What is a dangling pointer?
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.
What is the difference between NULL AND VOID pointer?
NULL can be value for pointer type variables.
VOID is a type identifier which has not size.
NULL and void are not same. Example: void* ptr = NULL;
If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.
What is "this" pointer?
This pointer is a pointer which points to the current object of a class. this is actually a keyword which is used as a pointer which differentiate the current object with global object.
What is datatype of pointer?
Pointer can be of any datatype and is not restricted to the size of that particular datatype. Pointer is a variable of 4byte as all address in a 32 bit computer are of 4 byte length. So what about 64 bit computers? Well in 64 bit computers the pointer size will vary, but if we rum a 32 bit pointer in 64 bit system then we will find half of the pointer's field is empty like 0x000000.
How a pointer stores address?
A pointer is a variable which stores address of other variable. Pointer only stores the first byte of address and then we can find upcoming bytes according to the size of the variable.
For example if a variable of integer type is being accessed by a pointer. So the pointer will only store the first byte of the address and as integer datatype takes two bytes memory the next byte of address location can be find out by adding 1 to the first byte of the address.
Difference between a java object reference and c++ pointer.
The prime difference is that pointers are to locate the address of the primitive variables only, where as object reference locates the object in the heap.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend