title: Array of struct modify with pointer
body: <p>I wanna function to  modify each element of array of structure with pointer.  </p>
  
  <p>I am using two different size arrays </p>
  
  <pre><code>struct color 
  {
  
      char red;
      char blue;
      int white;
  };
  
  struct colorInit
  {
  
      char red;
      char blue;
      int white;
      int padding[60]; 
  };
  
  
  struct color batch1[30];
  
  struct colorInit batchInitializd[30]; 
  
  void modifystruct ( struct color *ptr)
  
  {
  
    for ( int i = 0; i &lt; 30; i++)
  
    {
  
       ptr[i].red = batchInitializd[i].red;
  
       ptr[i].white = batchInitializd[i].white;
  
       ptr[i].blue = batchInitializd[i].blue;
  
  }
  
  }
  </code></pre>
  
  <p>am i using pointer right way in the function ? </p>