title: Reading/writing C++ vector to a file
body: <p>I want to store vector to a file and read it line by line for each vector.</p>
  <pre><code>vector&lt;int&gt; vec1 = {1,1,0,1};
  vector&lt;int&gt; vec2 = {1,0,0,1,1,1};
  vector&lt;int&gt; vec3 = {1,1,0};
  ...
  </code></pre>
  <pre><code>data.txt
  1 1 0 1
  1 0 0 1 1 1
  1 1 0
  ...
  </code></pre>
  <p>I read this page and still confused. <a href="http://www.cplusplus.com/forum/general/165809/" rel="nofollow noreferrer">http://www.cplusplus.com/forum/general/165809/</a></p>