fork(2) download
  1. #include <iostream>
  2. #include <bitset>
  3. using namespace std;
  4.  
  5. bitset<4> nibble(int val, int k) {
  6. return val >> (4*k);
  7. }
  8.  
  9. int main() {
  10. uint32_t val = 1265985549;
  11. cout << hex << val;
  12. for( auto k: { 7, 6, 5, 4, 3, 2, 1, 0 } )
  13. cout << ' ' << nibble(val, k);
  14. cout << endl;
  15. }
  16.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
4b75680d 0100 1011 0111 0101 0110 1000 0000 1101