fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int x1 = 1, x2 = 2, x3 = 3, x4 = 4;
  5. int* p1;
  6. p1 = &x1;
  7. *p1 = 10;
  8. const int* p2;
  9. p2 = &x2;
  10. //*p2 = 20;
  11. int* const p3 = &x3;
  12. //p3 = &x1;
  13. *p3 = 30;
  14. const int* const p4 = &x4;
  15. //p4 = &x2;
  16. //*p4 = 40;
  17. printf("%d %d %d %d", *p1, *p2, *p3, *p4);
  18. }
  19.  
  20. //http://pt.stackoverflow.com/q/190203/101
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
10 2 30 4