programming-examples/c/Basic/Accessing an array using pointers.c

17 lines
329 B
C
Raw Normal View History

2019-11-18 14:44:36 +01:00
#include <stdio.h>
main(){
int a[5];
int i;
for(i = 0;i<5;i++){
a[i]=i;
}
int *b;
b=a;
for(i = 0;i<5;i++){
printf("value in array %d and address is %16lu\n",*b,b);
b=b+2;
}
}