Set a double to byte array : <p>what's a fast way of assigning a double to 8 bytes inside a byte array?</p>

<p>I have a byte array that is about 4k bytes big and I am attempting to take 8 bytes out of that and copy it into a double. I am trying to avoid memmove and memcpy for speed reasons, as assigning variables is much faster. I am working in embedded world, any other fast implementations are appreciated.</p>

<pre><code>void foo(double *pdest)
{
   // Try 1: I am using 1 element in the array, it won't work
   *pdest = (double)p-&gt;stk[stkpos];

   // Try 2: I am attempting to loose the single element element
   *pdest = (double)((double*)&amp;p-&gt;stk[stkpos]);
}
</code></pre>

<p>Neither solutions have worked for me, I am not sure how I can achieve this.</p>
