title: How to write vector<uint_8> to a file in c++?
body: <p>I have vector&lt;uint_8&gt; data filled and want to write this data into a file using c++? Tried out but didn't find any reference.</p>
  <pre><code>const std::vector&lt;uint8_t&gt;  buffer; // let's assume that i'ts filled with values
  std::ofstream out(&quot;file.txt&quot;, std::ios::out | std::ios::binary);
  out.write(&amp;buffer, buffer.size());
  </code></pre>
  <p>but not successfull. Also is it correct to open file in binary mode for this?</p>