title: Array of structs - deleting/adding elements and printing
body: <p>For the below code</p>
  
  <pre><code>struct orderSlip
  {
      char source[64];
      char destination[64];
      char item[64];  
      int position;
  };
  //global
  struct orderSlip data[100];
  </code></pre>
  
  <p>Is there another way of printing out the data for each element other than these methods below:</p>
  
  <pre><code>printf("%s\n",data[0].source);
      printf("%s\n",data[0].destination);
      printf("%s\n",data[0].item);
      printf("%i\n\n", data[0].position);
  
      printf("%s\n",data[1].source);
      printf("%s\n",data[1].destination);
      printf("%s\n",data[1].item);
      printf("%i\n", data[1].position);
  </code></pre>
  
  <p>etc</p>
  
  <pre><code>for(int n = 0; n&lt; 3; n++)
  {
      printf("%s\n",data[n].source);
      printf("%s\n",data[n].destination);
      printf("%s\n",data[n].item);
      printf("%i\n\n", data[n].position);
  }
  </code></pre>
  
  <p>For deleting and adding, do I have to make a dynamic array of structs? If so, what would be the simplest syntax to do that?
  Something like this c++ code</p>
  
  <pre><code>int * bobby;
  bobby = new int [5];
  delete bobby[5];
  </code></pre>
  
  <p>but in C? I'm guessing it has do with malloc and free</p>