C Programming Code Examples C > Pointers Code Examples Int array and its pointer Int array and its pointer #include <stdio.h> int main(void) { int a[10] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; int *p; p = a; /* assign p the address of start of array a */ /* output a's first, second and third elements using pointer */ printf("%d %d %d\n", *p, *(p+1), *(p+2)); /* this does the same thing using a */ printf("%d %d %d", a[0], a[1], a[2]); return 0; }