fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5. double db1, db2;
  6. int in1, in2;
  7. char cr1, cr2;
  8. char *ch;
  9.  
  10.  
  11. printf("db1\t\t%p\t%zu\n", (void*)&db1, sizeof(db1));
  12. printf("db2\t\t%p\t%zu\n", (void*)&db2, sizeof(db2));
  13. printf("in1\t\t%p\t%zu\n", (void*)&in1, sizeof(in1));
  14. printf("in2\t\t%p\t%zu\n", (void*)&in2, sizeof(in2));
  15. printf("cr1\t\t%p\t%zu\n", (void*)&cr1, sizeof(cr1));
  16. printf("cr2\t\t%p\t%zu\n", (void*)&cr2, sizeof(cr2));
  17. printf("ch\t\t%p\t%zu\n", (void*)&ch, sizeof(ch));
  18.  
  19. in1 = 0x1A2B3C4D;
  20. ch = (char*)&in1;
  21.  
  22. printf("\n Содержимое in1 = 0x%08X по байтам:\n", in1);
  23. for (int i = 0; i < (int)sizeof(in1); i++) {
  24. printf("Байт %d: 0x%02X\n", i, (unsigned char)ch[i]);
  25. }
  26.  
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
db1		0x7ffe283161e0	8
db2		0x7ffe283161e8	8
in1		0x7ffe283161d8	4
in2		0x7ffe283161dc	4
cr1		0x7ffe283161d6	1
cr2		0x7ffe283161d7	1
ch		0x7ffe283161f0	8

 Содержимое in1 = 0x1A2B3C4D по байтам:
Байт 0: 0x4D
Байт 1: 0x3C
Байт 2: 0x2B
Байт 3: 0x1A