title: how to bit shift the variable and form the whole value
body: <p>I have the following code in C:</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  uint32_t result;
  uint8_t bit[4] = {1, 2, 3, 4};
  </code></pre>
  
  <p>since each element of <code>bit</code> array takes 8 bits, and variable <code>result</code> take 32 bits, I want to form the <code>result</code> using 4 elements in the <code>bit</code> array, <code>bit[0]</code> takes the most significant bit(MSB) 8 bits of <code>result</code>, <code>bit[1]</code> takes the second MSB 8 bits of <code>result</code>,  <code>bit[2]</code> takes the third MSB 8 bits of <code>result</code>,  <code>bit[3]</code> takes the least significant bit 8 bits of <code>result</code>, how to form it in C?</p>
  
  <p>I know the bit shift operator, but after shift all the elements, how to combine them together to form a value?</p>