title: How to append two arrays in C language?
body: <p>How can I include the elements of array X and Y in to array <code>total</code> in C language ?
  can you please show with an example.</p>
  
  <pre><code>X = (float*) malloc(4);
  Y = (float*) malloc(4);
  total = (float*) malloc(8);
  
  for (i = 0; i &lt; 4; i++)
  {
      h_x[i] = 1;
      h_y[i] = 2;
  }
  
  //How can I make 'total' have both the arrays x and y
  //for example I would like the following to print out 
  // 1, 1, 1, 1, 2, 2, 2, 2
  
  for (i = 0; i &lt; 8; i++)
      printf("%.1f, ", total[i]);
  </code></pre>