fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const int a = 15;
  6. int *b = const_cast<int*>(&a);
  7. *b = 5;
  8. cout << a << " " << *b << "\n";
  9. cout << &a << " " << b << "\n";
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
15 5
0x7fff315b9084 0x7fff315b9084