fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <inttypes.h>
  4.  
  5. int main(void)
  6. {
  7. void *ptr = (char[]){'9', '8', '7', '6', '5', '4', '3', '2'};
  8. uint64_t* a = ptr;
  9. *a =((*a & 0x0F000F000F000F00)>>8) +
  10. ((*a & 0x000F000F000F000F)*10);
  11.  
  12. *a = 1000000 * ((*a >> 0 ) & 0xFF) +
  13. 10000 * ((*a >> 16) & 0xFF) +
  14. 100 * ((*a >> 32) & 0xFF) +
  15. ((*a >> 48) & 0xFF);
  16. //little-endian only. Можно переделать под big-endian
  17. printf("%"PRIu64, *a);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 1832KB
stdin
Standard input is empty
stdout
98765432