title: Serializing Struct of vectors of vector
body: <p>I`m in a bit complicated situation here.
  I want to save a struct of vectors to a file and read it after some time.
  But the problem is with the reading. I dont know how i can fill al vectors into structure from the saved file.   </p>
  
  <pre><code> struct TDNATable{
  
  
          std::vector&lt;String&gt;GenomOne;
          std::vector&lt;String&gt;GenomeL;
          std::vector&lt;String&gt;GenomeER;
          std::vector&lt;String&gt;GenomeRET;
          std::vector&lt;String&gt;GenomeSEL;
  
      };
  
      std::vector&lt;TDNATable&gt; DnaTbl;
  
  
  
  //PSEUDO CODE:
      //For example simple writing could be
      ofstream file("C:\\Users\\User11\\Desktop\\SNF_TBL.INI", ios::binary);
      file.write((char*)&amp;DnaTbl, sizeof(DnaTbl));
  
  //Problem comes with reading 
   // impl
      ifstream file("C:\\Users\\User11\\Desktop\\SNF_TBL.INI",
          std::ifstream::binary);
  
      // get pointer to associated buffer object
      std::filebuf* pbuf = file.rdbuf();
  
      // get file size using buffer's members
      std::size_t size = pbuf-&gt;pubseekoff(0, file.end, file.in);
      pbuf-&gt;pubseekpos(0, file.in);
  
      // allocate memory to contain file data
      char* buffer = new char[size];
  
      // get file data
      pbuf-&gt;sgetn(buffer, size);
  
      file.close();
  
  
  for (int i = 0; i &lt; SnfTbl.size(); i++) {
  
  //Back inserter can be used only with 1D vector        
  std::copy(buffer, buffer +sizeof(buffer),
              std::back_inserter(SnfTbl[i].GenomeL);
  
          std::copy(buffer, buffer +sizeof(buffer),
              std::back_inserter(SnfTbl[i].GenomeER));
  
  
  
      }
  
      RefreshDFSGrid();
  
  
      delete[]buffer;
      file.close();
  </code></pre>
  
  <p>I tried with boost/serialize but without sucsess.</p>
  
  <p>Do you have any idea how can i save/load this ds in a elegant way?
  Thanks!</p>