fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. const int t_const = 42;
  7.  
  8. cout << t_const << endl;
  9.  
  10. int & t_mutable = const_cast< int & >( t_const );
  11. t_mutable = 43;
  12. cout << t_mutable << endl;
  13.  
  14. cout << t_const << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
42
43
42