What are dangling pointers? How are dangling pointers different from memory leaks?

Answer Posted / hrpynux@gmail.com

So dangling pointer is nothing but a pointer which is pointing a dynamic variable whose scope is already finished. Memory leak: When there is a memory area in a heap but no variable in the stack pointing to that memory.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2098


what is the height of tree if leaf node is at level 3. please explain

1838


What is a good way to implement complex numbers in c?

802


When should a far pointer be used?

804


What are the advantages and disadvantages of pointers?

817


How do I convert a string to all upper or lower case?

878


What is floating point constants?

894


How do you determine the length of a string value that was stored in a variable?

870


Explain what is the advantage of a random access file?

903


When is a “switch” statement preferable over an “if” statement?

872


What is uint8 in c?

882


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

857


What is the condition that is applied with ?: Operator?

889


What functions are used in dynamic memory allocation in c?

801


What is calloc() function?

858