title: copy two arrays of int to one char* in C
body: <p>I have to arrays of int for example <code>arr1={0,1,1,0,0}</code>, <code>arr2={1,0,1,1,1}</code> and I need to return 1 char* created by <code>malloc</code> that will be shown like this : <code>"01100,10111"</code>.
  when I do for loop it doesn't work, how can I do it ?</p>
  
  <pre><code>char* ans = (char*)malloc((size * 2+1) * sizeof(int));
  for (int i = 0; i &lt; size; i++)
      ans[i] = first[i];
  ans[size] = ",";
  for (int i = size+1; i &lt; 2*size+1; i++)
      ans[i] = second[i];
  </code></pre>