title: C++ string to binary code / binary code to string
body: <p>I need to convert a string into a string with the binary code of the first string.
  For the first part i used this: <a href="https://stackoverflow.com/questions/10184178/fastest-way-to-convert-string-to-binary">Fastest way to Convert String to Binary?</a> Worked perfectly but i can't figure out a way to write it into a new string.</p>
  
  <p>Here's the code i'm using so far:</p>
  
  <pre><code>for (size_t i = 0; i &lt; outputInformations.size(); ++i)
  {
      cout &lt;&lt; bitset&lt;8&gt;(outputInformations.c_str()[i]);
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>01110100011001010111001101110100011101010111001101100101011100100110111001100001011011010110010100001010011101000110010101110011011101000111000001100001011100110111001101110111011011110111001001100100
  </code></pre>
  
  <p>Is there a way to write this into a new string? So that i have a string called "binary_outputInformations" with the binary code inside it.</p>