title: Correct way of copying an array of char pointers?
body: <p><strong>Task:</strong></p>
  
  <p>I have an array of records in <code>filtered_records</code>, with the number of filtered records in 
  <code>num_filtered_records</code>. I want to duplicate this information in <code>binfo-&gt;filtered_records</code>
  and <code>binfo-&gt;num_filtered_records</code> since <code>filtered_records</code> are free'd later in my code.</p>
  
  <p><strong>Definitions:</strong></p>
  
  <pre><code>char** filtered_records;
  size_t num_filtered_records;  
  </code></pre>
  
  <p><strong>Snippet:</strong></p>
  
  <pre><code>binfo-&gt;filtered_records = malloc(num_filtered_records*sizeof(char*));
  
  memcpy(binfo-&gt;filtered_records, 
         filtered_records,
         num_filtered_records * sizeof(char*));
  </code></pre>
  
  <p><strong>Issue:</strong></p>
  
  <p>When I print <code>binfo-&gt;filtered_records</code>, I see all the records, but some of the records have
  been replaced by values which are just incorrect. I am not sure what I am missing. </p>