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

Explain 'bus error'?

797


What is volatile variable in c with example?

801


What are the differences between Structures and Arrays?

886


What are the 4 data types?

798


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

1056


if p is a string contained in a string?

1637


Explain threaded binary trees?

930


Explain the use of function toupper() with and example code?

891


What is a void * in c?

857


Why dont c comments nest?

854


What is a node in c?

760


Explain how do you list files in a directory?

846


How can I change their mode to binary?

913


What is the return type of sizeof?

832


Explain the use of #pragma exit?

938