title: memcpy float variable into uint8_t array
body: <p>I am trying to extract some float variables out of a array of type uint8_t filled from an SPI transfer.
  However so far I wasn't able to achieve the correct extraction, so I wrote a small program so understand what I do wrong.</p>
  <p>First of all I just filled the buffer with some floats and wanted to check if it's done correctly. I noticed when using memcpy to copy float variables to the buffer and printing the buffers content afterwards it still contains all zeros. However when assigning the float variable directly to the space where each buffer position points (currently commented out line below memcpy function) to the initialization of the buffer works the way I want.</p>
  <p>Can somebody point out my mistake please.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  #define MAX_MSG_LEN 64
  
  static uint8_t buffer_rx[MAX_MSG_LEN];
  
  int main(){
      for(int i=0; i&lt;MAX_MSG_LEN/sizeof(float); i++){
          float myFloat = (float)i;
          printf(&quot;myFloat = %f\n&quot;, myFloat);
          printf(&quot;buffer_rx+sizeof(float)*%d = %p\n&quot;, i, (void*)(&amp;buffer_rx[sizeof(float)*i]));
          memcpy(&amp;buffer_rx[sizeof(float)*i], &amp;myFloat, sizeof(float));
          //buffer_rx[sizeof(float)*i] = myFloat;
          printf(&quot;buffer_rx[%d] = %f\n&quot;, i, (float)(buffer_rx[sizeof(float)*i]));
      }
  
  }
  </code></pre>