title: How to "combine" two int arrays?
body: <p>Hello i have a little problem trying to "mix" two string arrays, i have searched about it but i have only found how to merge them or concatenate them, but thats not what i need.</p>
  
  <p>i have two int arrays like this:</p>
  
  <pre><code>int no_items = 5;
  int parent1[no_items], parent2[no_items];
  </code></pre>
  
  <p>if the arrays contains for example:</p>
  
  <pre><code>parent1[0] = 1;
  parent1[1] = 2;
  parent1[2] = 3;
  parent1[3] = 4;
  parent1[4] = 5;
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>parent2[0] = 5;
  parent2[1] = 1;
  parent2[2] = 2;
  parent2[3] = 3;
  parent2[4] = 4;
  </code></pre>
  
  <p>given a "cross" point, for example 2:
  parent1 should have his 2 first elements and the rest of parent2, and parent2 should have his first 2 elements and the rest of parent1. So the result should be:</p>
  
  <pre><code>parent1: 1,2 | 5,3,4
  parent2: 5,1 | 2,3,4
  </code></pre>
  
  <p>where "|" is the break point index and <strong>the rest of elements should not be repeated.</strong></p>
  
  <p>How can i get this kind of mixing two int arrays? Thanks you!</p>
  
  <p>at the moment i have this:</p>
  
  <pre><code> for(i = 0; i &lt; cross_point; i++)
      {
          sprintf(buffer, "%d,", parent1[i]);
          strcat(line1, buffer);
      }
      for(i = 0; i &lt; cross_point; i++)
      {
          sprintf(buffer, "%d,", parent2[i]);
          strcat(line2, buffer);
      }
  </code></pre>
  
  <p>but i don´t know how to go further than the cross point.</p>