title: How to delete one data line from a structure array ? (with index)
body: <p>I am trying to make a function, which deletes one line from a structure array, I give function the index of line I want to delete and the structure array. E.g. we have structure array :</p>
  
  <pre><code>Structure
  {
  string First;
  string Second;
  string Third;
  string Fourth;
  string Fifth;
  }
  </code></pre>
  
  <p>Structure array :</p>
  
  <pre><code>Structure A[100];
  int n;
  </code></pre>
  
  <p>So there are five string type elements in this structure array :</p>
  
  <pre><code>A[i].First A[i].Second A[i].Fourth A[i].Fifth // i is the index
  </code></pre>
  
  <p>Our function is like this :</p>
  
  <pre><code>void Delete(Structure A[], int index, int &amp; n) 
  {
  
  Structure t;
  
  for (int i = index; i &lt; n-1; i++)
  {
      t = A[i];
      A[i] = A[i + 1];
      A[i + 1] = t;
      n--;
  } 
  }
  </code></pre>
  
  <p>So I give function index and I want the function to delete all elements of my structure array with that index ( so how can I take like the whole "line" of those elements, instead of deleting them one by one ?)</p>
  
  <pre><code>A[index].First A[index].Second A[index].Third A[index].Fourth A[index].Fifth
  </code></pre>
  
  <p>The function however doesn't work. Can you give me some tips/advises/suggestions, please ? Thanks in advance.</p>