title: Using memcpy from a pointer to an array
body: <p>I have a <code>typedef struct</code>named "item" that contains 2 <code>char[254]</code> (Name of product and Name of company) and 9 <code>int</code> variables. (Price, Amount,etc..).</p>
  
  <p>I created a pointer from that <code>typedef struct</code> and one array(1D) and one Two Dimensional array.</p>
  
  <p>I have used <code>scanf</code> to store data to the pointer's respective variables (No problem so far).</p>
  
  <p>Now, I want to "copy and store" the data of the pointer's variables into the array (1D) then "copy and store" the data of the 1D array to the 2D array.</p>
  
  <p>For pointer to 1D array, this is what I did:</p>
  
  <pre><code>void pointer_conversion(item *a, item curr[10000], int total)
  {
  memcpy(&amp;curr[total], a, sizeof(item*));
  } 
  // Tried doing: memcpy(&amp;curr[total],a,sizeof(item*) * 100); 
  // Why 100?= just to be safe.  But still not working.
  </code></pre>
  
  <p>Now, this function copys and stores the first <code>char[254]</code> of the pointer <code>a</code> into 1D array <code>curr</code> but the rest of the variables of the <code>typedef struct</code> is <code>NULL</code>. </p>
  
  <p>Any advice?</p>
  
  <h2>(Using VS2012 on Windows)</h2>
  
  <pre><code>typedef struct nodebase{
      char productname[254];
      char companyname[254];
      int price;
      int stocks;
  //....
      struct nodebase *next; //Use the struct as linked-list
  }item;
  </code></pre>