fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a = 10;
  5. float b = 5.5;
  6. char c = 'X';
  7. double d = 20.123;
  8.  
  9. int *p1 = &a;
  10. float *p2 = &b;
  11. char *p3 = &c;
  12. double *p4 = &d;
  13.  
  14. printf("INT : value=%d, pointer=%p, value at pointer=%d\n", a, p1, *p1);
  15. printf("FLOAT : value=%.1f, pointer=%p, value at pointer=%.1f\n", b, p2, *p2);
  16. printf("CHAR : value=%c, pointer=%p, value at pointer=%c\n", c, p3, *p3);
  17. printf("DOUBLE : value=%.3f, pointer=%p, value at pointer=%.3f\n", d, p4, *p4);
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
INT : value=10, pointer=0x7ffdfe9c9008, value at pointer=10
FLOAT : value=5.5, pointer=0x7ffdfe9c900c, value at pointer=5.5
CHAR : value=X, pointer=0x7ffdfe9c9007, value at pointer=X
DOUBLE : value=20.123, pointer=0x7ffdfe9c9010, value at pointer=20.123