title: C++ invalid cast from type ‘void*’ to type ‘double’
body: <p>How can I cast a void pointer to a double, retaining the exact binary stored in the void pointer? I thought this could be done with <code>reinterpret_cast&lt;double&gt;(voidp)</code>, but g++ doesn't let me. I know you can cast void pointers to integers, so I tried <code>reinterpret_cast&lt;double&gt;(reinterpret_cast&lt;long&gt;(voidp))</code>, but apparently that's also invalid. <code>sizeof(double)</code> and <code>sizeof(void*)</code> are both 8, so it can't be a size thing. Is there anything I can do to accomplish this?</p>
  
  <p>EDIT: The double in this case is not pointed to by the void pointer, but /is/ the void pointer - the pointer itself contains the data I want, it does not point to the data I want.</p>