fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int x = 5;
  6. const int y = x;
  7. int* ptr = (int*)&y;
  8. *ptr = 10;
  9. std::cout << y;
  10. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
10