#include<stdio.h>
#include<conio.h>
void main()
{
int i;
static int a[]={0,1,2,3,4};
int *p[]={a,a+1,a+2,a+3,a+4};
int **ptr=p;
clrscr();
for(i=0;i<5;i++)
{
printf("a=%d\n",&a[i]);
printf("p is address=%d\n",p[i]);
printf("p value=%d\n",*p[i]);
printf("*ptr=%d\n",*ptr[i]);
printf("\n**ptr=%\dn",**ptr);
printf("\nBREAK\n" );
}
output
a=170
p is address=170
p value=0
*ptr=0
**ptr=0n
BREAK
a=172
p is address=172
p value=1
*ptr=1
**ptr=0n
BREAK
a=174
p is address=174
p value=2
*ptr=2
**ptr=0n
BREAK
a=176
p is address=176
p value=3
*ptr=3
**ptr=0n
BREAK
a=178
p is address=178
p value=4
*ptr=4
**ptr=0n
BREAK
No comments:
Post a Comment