title: How to properly convert an unsigned char array into an uint32_t
body: <p>So, I'm trying to convert an array of <code>unsigned char</code>s into an <code>uint32_t</code>, but keep getting different results each time:</p>
  
  <pre><code>unsigned char buffer[] = {0x80, 0x00, 0x00, 0x00};;
  uint32_t num = (uint32_t*)&amp;buffer;
  </code></pre>
  
  <p>Now, I keep getting this warning: </p>
  
  <blockquote>
    <p>warning: initialization makes integer from pointer without a cast</p>
  </blockquote>
  
  <p>When I change <code>num</code> to <code>*num</code> i don't get that warning, but that's not actually the real problem (<strong>UPDATE:</strong> well, those might be related now that I think of it.), because <em>every time I run the code there is different results</em>. Secondly the <code>num</code>, once it's cast properly, should be <code>128</code>, but If I need to change the endianness of the buffer I could manage to do that myself, <em>I think</em>.</p>
  
  <p>Thanks!</p>