Difference between null pointer and dangling pointer?

Answer Posted / ravi

Both are very different.
NULL macro is
#define NULL 0
it means the macro NULL will be replaced by 0 while
preprocessing
But the NULL pointer means it points to nowhere i.e. contains 0.
It contains 0 means it may be dangerous to use such pointer
without assigning proper address to it otherwise NULL
pointer may try to access reset address may cause the
program to crash.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of ftell?

800


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2963


How do we open a binary file in Read/Write mode in C?

945


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15413


Define the scope of static variables.

798






How many bytes is a struct in c?

886


Explain what are compound statements?

788


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1695


What does s c mean in text?

803


Explain zero based addressing.

767


Is null always defined as 0(zero)?

803


What is conio h in c?

797


What is a structure and why it is used?

829


What is structure in c explain with example?

835


What is array of pointers to string?

769