fork download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. volatile unsigned int a = 1;
  9. volatile unsigned int b = 2;
  10. volatile unsigned int c = 3;
  11. volatile unsigned int* temp = &a;
  12. for(int i = 0; i < 20; ++i)
  13. {
  14. cout << (void*)&a << "-" << (void*)&b << "-" << (void*)&c << "-" << (void*)temp << " " << *temp << endl;
  15. temp++;
  16. }
  17. }
  18.  
Success #stdin #stdout 0s 4500KB
stdin
Standard input is empty
stdout
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf6c   1
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf70   2
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf74   3
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf78   3445347072
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf7c   445993472
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf80   2994653984
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf84   10922
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf88   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf8c   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf90   854164400
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf94   22016
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf98   854164144
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcf9c   22016
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfa0   3230650512
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfa4   32767
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfa8   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfac   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfb0   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfb4   0
0x7fffc08fcf6c-0x7fffc08fcf70-0x7fffc08fcf74-0x7fffc08fcfb8   2997095275