by Dinesh Thakur Category: Function and Pointer
#include <stdio.h>
int main ()
  int Array [ ] = {10, 20, 40, 50,60} ;
  int i;
  int* pArray = Array; // defining the pointer to array Array
  for (i=0 ; i<5;i++) //loop for output of array elements
  printf("Array[%d]= %d,\t *(pArray+%d) = %d\n",i,Array[i],i,*(pArray+i) ); // *(pArray +i)is the value of Array[i]element of array.
  return 0;
The output is as given below. The explanation is already given above

C Program pointers for traversing an array

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles