title: How to remove an element from a struct array which has pointers?
body: <p>This is my structure which has two integer pointers aV and aT. </p>
  
  <pre><code>struct ADJP
  {
      int *aV;
      int eV;
      int nV;
      int *aT;
      int nT;
  };
  ADJP *Umb = NULL;
  </code></pre>
  
  <p>The allocation process of aV and aT is like this..</p>
  
  <pre><code>    for(int i=0; i&lt;nb; i++)
      {
          Umb[i].aV = new int[N];
          for(int j=0; j&lt;n; j++)
              Umb[i].aV[j] = pIn[i].aV[j];
  }
  </code></pre>
  
  <p>I want to remove one specific element from Umb array. for example I want to remove Umb[5], then how can I remove. I have tried with various mathods but got error due to allocated pointers I think. I have tried with follow method but its not working with this kind of struct array. It is working with struct array having no pointers.</p>
  
  <pre><code>int DeleteStructElement(int Index, ADJP *b, int N, int at)
  {
      for(int i=Index; i&lt;N-1; i++)
          memmove(&amp;b[i], &amp;b[i+1], (N-at-1)*sizeof*b);     // moving the terms of array
      N--;                                                // updating new size
      return N;
  }
  </code></pre>
  
  <p>Have any idea how to remove an element from my struct array? </p>