initial import
[staff/goc4/2018bti7061.git] / c-4-pointers / examples / c-pointers / pointers6.c
1 #include <stdio.h>
2
3 main(){
4 static int x[10] = {10,11,12,13,14,15,16,17,18,19};
5
6 int i;
7 for( i = 0; i <= 9; ++i){
8 printf("i = %d; x[%d] = %d; *(x+%d)=%d \n",i,i,x[i],i,*(x+i));
9 printf(" &x[%d] = %X; x+%d=%X \n",i,&x[i],i,x+i);
10 }
11 /* Output:
12 i = 0; x[i] = 10; *(x+i)=10
13 &x[i] = 601040; x+i=601040
14 i = 1; x[i] = 11; *(x+i)=11
15 &x[i] = 601044; x+i=601044
16 i = 2; x[i] = 12; *(x+i)=12
17 &x[i] = 601048; x+i=601048
18 ...
19 */
20
21
22 }