title: using pointers to display content of array
body: <p>I am stuck about how to use pointers to display array. I can easily do this with array using for loop but I am interested in knowing how to use via pointers and I am stuck how to calculate starting and ending point of an array.   </p>
  
  <p>Below is the sample program</p>
  
  <pre><code> void printArray(int *ptr);            
  {         
      //for statement to print values using array             
      for( ptr!=NULL; ptr++) // i know this doesn't work         
      printf("%d", *ptr);        
  }         
  
  int main()    
  {    
      int array[6] = {2,4,6,8,10};     
      printArray(array);    
      return 0;     
  }
  </code></pre>