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
What is a const pointer?
Explain what happens if you free a pointer twice?
Why is c called c not d or e?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
How to create struct variables?
What is memcpy() function?
What are header files why are they important?
What are the applications of c language?
List some applications of c programming language?
Is null always defined as 0(zero)?
What do you mean by scope of a variable in c?
How do you determine the length of a string value that was stored in a variable?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
Explain goto?
Define the scope of static variables.