title: void* of a bool[] conversion to std::string
body: <p>I need to save some data and the only viable option is a <code>std::string</code>; so I get a bool array passed as a <code>void*</code>. Now I need to save it in a way that I can convert it into a <code>std::string</code> and be able read a <code>void*</code> to a <code>bool[]</code> from that exact string. Sadly I got lost in conversion.</p>
  
  <pre><code>f(const void* data, int length){
  
     bool** boolPointer = (bool**)(data);
     bool boolArray[length];
  
     for (int i=0; i&lt;=length; i++){
         boolArray[i] = p[sizeof(bool)*i];
     }
  
     std::string s = (std::string&amp;)boolArray;
  }
  </code></pre>
  
  <p>I'm pretty sure the last line is no viable conversion, but that was my attempt.</p>