title: Parsing char array efficiently in C
body: <p>I want to parse the char array efficiently. What is the correct way to do this in c. I'm new to c programming.  Please guide me. </p>
  
  <p>data is 32 byte. 1st byte is version, 2nd and 3rd bytes are sequence number and so on as listed below.</p>
  
  <pre><code>void parsepacket(u8_t data[]) {
      u8_t version = data[0];
      u16_t sequence_number = ?;
      u16_t error_status = ?;
      u8_t command_type = ?;
      u8_t attribute_count = ?;
      u8_t pay_load[25] = ?;
  }
  </code></pre>