title: How to extract values of different sizes from an array of uint8_t?
body: <p>I am trying to receive a message of a TCP socket and store it in an <code>uint8_t</code> array.
  The buffer I am to receive is to be 8 bytes long and contains 4 unique values. 
  Byte 1: value 1 which is a uint8_t, Byte 2-3: value 2 which is a uint16_t, Byte 4: value 3 which is a uint8_t, Byte 5-8: value 4 which is an unsigned long.
  Endiannessis big endian order.</p>
  
  <pre><code>int numBytes = 0;
  uint8_t buff [8];
  if ((numBytes = recv(sockfd, buff, 8, 0)) == -1)
  {
      perror("recv");
      exit(1);
  }
  
  uint8_t *pt = buff;
  printf("buff[0] = %u\n", *pt);
  ++pt;
  printf("buff[1] = %u\n", *(uint16_t*)pt);
  </code></pre>
  
  <p>But the second <code>printf</code> prints out an unexpected value. Have I done something incorrectly to extract the two bytes or is something wrong with my print function?</p>