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
Explain what are compound statements?
what are # pragma staments?
What is conio h in c?
What does 3 mean in texting?
Between macros and functions,which is better to use and why?
Do string constants represent numerical values?
Can variables be declared anywhere in c?
How do we make a global variable accessible across files? Explain the extern keyword?
How does free() know explain how much memory to release?
Why do we use header files in c?
What is extern variable in c with example?
How can I open files mentioned on the command line, and parse option flags?
Is main is user defined function?
How can I remove the trailing spaces from a string?
Is void a keyword in c?