fork download
  1. #include <iostream>
  2. #include <bitset>
  3.  
  4. using namespace std;
  5.  
  6. constexpr bitset<48> bits(uint16_t i1, uint16_t i2, uint16_t i3) {
  7. return {uint64_t(i1) << 32 | uint64_t(i2) << 16 | i3};
  8. }
  9.  
  10. int main()
  11. {
  12. constexpr int32_t garbage = int32_t(0XFFFF0000);
  13. constexpr int32_t int1 = 0b0000111100001111 + garbage;
  14. constexpr int32_t int2 = 0b1111000011110000 + garbage;
  15. constexpr int32_t int3 = 0b0101010101010101 + garbage;
  16.  
  17. cout << bits(int1, int2, int3).to_string() << endl;
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
000011110000111111110000111100000101010101010101