fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int a = 0x11223344;
  6. int b = 0x12345678;
  7.  
  8. int *p = &b;
  9. char *q = &b;
  10.  
  11. printf("%d %d\n", sizeof(p), sizeof(q)); // 4 4
  12.  
  13. printf("%p %x\n", p, *p);
  14. printf("%x\n", *(unsigned char *)p);
  15. p = (unsigned char *)p + 1;
  16. printf("%x\n", *(unsigned char *)p);
  17.  
  18. p = &b;
  19.  
  20. p++;
  21. printf("%p %x\n", p, *p);
  22.  
  23. printf("%p %x\n", q, *q);
  24. q++;
  25. printf("%p %x\n", q, *q);
  26. q++;
  27. printf("%p %x\n", q, *q);
  28. q++;
  29. printf("%p %x\n", q, *q);
  30. q++;
  31. printf("%p %x\n", q, *q);
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
8 8
0x7ffcc7388bc4 12345678
78
56
0x7ffcc7388bc8 432e8c00
0x7ffcc7388bc4 78
0x7ffcc7388bc5 56
0x7ffcc7388bc6 34
0x7ffcc7388bc7 12
0x7ffcc7388bc8 0