what's a fast way of assigning a double to 8 bytes inside a byte array?
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.
void foo(double *pdest)
{
// Try 1: I am using 1 element in the array, it won't work
*pdest = (double)p->stk[stkpos];
// Try 2: I am attempting to loose the single element element
*pdest = (double)((double*)&p->stk[stkpos]);
}
Neither solutions have worked for me, I am not sure how I can achieve this.