fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. float data[6] = { 10.1, 20.2, 30.3, 40.4, 50.5 };
  5. float *p;
  6. // (1)
  7. p = data;
  8. while(*p) {
  9. printf("%f\n", *p);
  10. p++;
  11. }
  12. // (2)
  13. p = data;
  14. while(*p) {
  15. printf("address of %f: %p\n", *p, p);
  16. p++;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.02s 2680KB
stdin
Standard input is empty
stdout
10.100000
20.200001
30.299999
40.400002
50.500000
address of 10.100000: 0xbf8eff48
address of 20.200001: 0xbf8eff4c
address of 30.299999: 0xbf8eff50
address of 40.400002: 0xbf8eff54
address of 50.500000: 0xbf8eff58