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 string constants?

662


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

645


Which type of language is c?

653


Does sprintf put null character?

601


Differentiate between the expression “++a” and “a++”?

705






What is New modifiers?

669


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2201


What is the purpose of main( ) in c language?

622


Can math operations be performed on a void pointer?

587


What are the applications of c language?

626


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

671


How can I change the size of the dynamically allocated array?

632


What are types of preprocessor in c?

617


explain what are actual arguments?

635


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1592