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

regarding pointers concept

1564


How can I open files mentioned on the command line, and parse option flags?

583


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

646


What are the rules for the identifier?

660


Compare interpreters and compilers.

633






Which is an example of a structural homology?

769


what are # pragma staments?

1619


When should a type cast not be used?

619


what is event driven software and what is procedural driven software?

2003


What is %d used for?

579


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

858


Explain what are global variables and explain how do you declare them?

634


What is actual argument?

582


How are 16- and 32-bit numbers stored?

717


Are the variables argc and argv are local to main?

778