NULL Pointer in C.
#include<stdio.h>
#include<conio.h>
int main()
{
int b = 34;
int *pt = &b;
printf("The address of b is %d\n", pt);
int a = 34;
int *ptr = NULL;
if (ptr!= NULL)
printf("The address of a is %d\n", *ptr);
else{
printf("The pointer is a null pointer and can not be defrenced");
}
return 0;
}
OUTPUT:
The address of b is 6422288
The pointer is a null pointer and can not be defrenced
Tys
ReplyDeleteCC
ReplyDelete