C: Ponteiro para ponteiro

From AdonaiMedrado.Pro.Br
Revision as of 13:17, 17 April 2009 by Adonaimedrado (Talk | contribs) (New page: <code lang="c"> #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 ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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;
}