fork(1) download
  1. #include <inttypes.h>
  2. #include <stdint.h>
  3. #include <stdio.h>
  4.  
  5. void print(int64_t i) {
  6. printf("%" PRId64 "\n", i);
  7. printf("%" PRIu8 "\n", *((uint8_t*)&i));
  8. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 1));
  9. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 2));
  10. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 3));
  11. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 4));
  12. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 5));
  13. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 6));
  14. printf("%" PRIu8 "\n", *(((uint8_t*)&i) + 7));
  15. }
  16.  
  17. int main() {
  18. int64_t i = 922337203685477580;
  19. i *= 10;
  20. i += 8;
  21. print(i);
  22. if (i == -i) {
  23. printf("They are equal!\n");
  24. }
  25. print(-i);
  26. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
-9223372036854775808
0
0
0
0
0
0
0
128
They are equal!
-9223372036854775808
0
0
0
0
0
0
0
128