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



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

Answer / 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

More C Interview Questions

What is structure data type in c?

0 Answers  


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

0 Answers   TCS,


Explain the difference between ++u and u++?

0 Answers  


What is string function in c?

0 Answers  


Why header files are used?

0 Answers  






Explain how do you declare an array that will hold more than 64kb of data?

0 Answers  


if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?

4 Answers   Amazon, Apple, Bata, Google, NASA,


how to capitalise first letter of each word in a given string?

0 Answers  


main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}

3 Answers  


simple program of graphics and thier outpu display with a want what is out put of graohics in c language

1 Answers   CSC, HCL,


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

0 Answers   TISL,


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

0 Answers   Microsoft,


Categories