Mega Code Archive
Categories
/
C++
/
Development
Const_cast Demo
#include
using namespace std; void f(const double &i) { double &v = const_cast
(i); v = 100.0; } int main() { double x = 98.6; cout << x << endl; f(x); cout << x << endl; return 0; }