EmbLogic's Blog

To Understand Double Pointer Concept

#include<stdio.h>
int main()
{
int value=77,num=99;
int *pv=&value,*pn=&num;
int **ppi;
ppi=&pv;
printf(“**ppi=%d\n”,**ppi);
ppi=&pn;
printf(“**ppi=%d\n”,**ppi);
system(“pause”);
}
 

in this program we  use two pointer as shown in program . In this first two value are stored in two variable after that we pointed address of both variable using one pointer as shown in program and  address of the first pointer are stored in the other variable and as a second pointer we use second variable and if we print the second pointer then its shows the value as **ppi=77

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>