fork(6) download
  1. #include <iostream>
  2. #include <stdint.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. uint64_t x = 123703;
  7. cout << hex << x << dec << endl;
  8. const int K = 11;
  9. unsigned char idx[K+1]; // need one extra for overwrite protection
  10. unsigned char *dst=idx;
  11. for (unsigned char i = 0; i < 50; i++)
  12. {
  13. *dst = i;
  14. dst += x & 1;
  15. x >>= 1;
  16. }
  17. for (int j = 0; j < K; j++)
  18. cout << (int)idx[j] << " ";
  19. cout << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1e337
0 1 2 4 5 8 9 13 14 15 16