C: Ponteiro para ponteiro

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
#include <stdio.h>
 
int main(void)
{
	int **pp, *p, a;
	p=&a;
	pp=&p;
	scanf("%d",&a);
	printf("%d (*p) = %d (**pp) = %d (a)\n",*p,**pp,a);
	printf("%p (*pp) = %p (p) = %p (&a)\n",*pp,p,&a);
	printf("%p (pp) = %p (&p)\n",pp,&p);
	printf("%p (&pp)\n",&pp);
	return 0;
}