jweinst1
1/12/2018 - 7:59 PM

using const cast

using const cast

#include <iostream>

int main() {
  int i = 3;
  const int& j = i;
  int& h = const_cast<int&>(j);
  h += 4;
  std::cout << "Hello World!\n";
  std::cout << j << std::endl;
}