fork download
  1. /* C/C++ (gcc-4.3.4) */
  2. #include <stdio.h>
  3. int main() {
  4.  
  5. /*volatile*/ int i = 5;
  6. int j = 500;
  7.  
  8. int *p = &j;
  9.  
  10. printf( "%d %x\n", *p, p );
  11.  
  12. p++;
  13.  
  14. printf( "%d %x\n", *p, p ); // works correct with volatile (*p is 5)
  15. //printf( "%d %x\n", *p, &i ); // works correct without volatile
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
500 bfd0b1b4
-1076842032 bfd0b1b8