MaximCherchuk

Const_cast C++

Apr 3rd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     const int a = 5;
  7.     int &b = const_cast<int&>(a);
  8. //    a *= 5; /// Так низя
  9.     b *= 5;   /// А так нормал
  10.     cout << b << endl;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment