NULL Pointer
A pointer that is assigned NULL is called a null pointer.
#include
void main()
{
int a=10;
int *pa;
pa=&a;
printf(“address of a is %d”,pa);
printf(“nvalue at a is %d”,*pa);
pa=NULL;
printf(“nn”);
printf(“address of a is %d”,pa);
printf(“nvalue of a is %d”,*pa);
}
Pointer to a Pointer
A pointer can hold the address of another pointer variable. Then it will be called as pointer to pointer.
/* Program that declares a pointer to a pointer */
# include
void main( )
{
int i = 100;
int *pi;
int **pii;
pi = &i;
pii = π
printf (“Address of i = %u n”, &i);
printf (“Address of i = %u n”, pi);
printf (“Address of i = %u n”, *pii);
printf (“Address of pi = %u n”, &pi);
printf (“Address of pi = %u n”, pii);
printf (“Address of pii = %u n”, &pii);
printf (“Value of i = %d n”, i);
printf (“Value of i = %d n”, *(&i));
printf (“Value of i = %d n”, *pi);
printf (“Value of i = %d”, **pii);
}