fork(1) download
  1. #include <stdio.h>
  2. #include "stdint.h"
  3.  
  4. uint64_t get_value() {
  5. return 0x1020304050607080ULL;
  6. }
  7.  
  8. int main(void) {
  9. uint16_t flash[4] = {0};
  10. uintptr_t flash_addr = &flash;
  11. uint64_t value = get_value();
  12.  
  13. uint16_t* ptr = (uint16_t*)&value;
  14. uint16_t* dst = (uint16_t*)flash_addr;
  15. for (int i=0; i<4; ++i) {
  16. printf("*ptr = 0x%x\n", *ptr);
  17. *dst++ = *ptr++;
  18. }
  19.  
  20. printf("value = 0x%llx\n", value);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5452KB
stdin
Standard input is empty
stdout
*ptr = 0xa245
*ptr = 0xdc5b
*ptr = 0x55b8
*ptr = 0x0
value = 0x1020304050607080