fork download
  1. #include <iostream>
  2. #include <bitset>
  3.  
  4. int main() {
  5. // your code goes here
  6. uint8_t byte1 = 0b01010000;
  7. uint8_t byte2 = 0b00001111;
  8.  
  9. uint16_t data = (static_cast<uint16_t>(byte1) << 8) | byte2;
  10.  
  11. std::cout << std::bitset<16>(data);
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
0101000000001111