Code
C++——类型推导杂记
C++——类型转换杂记
const_cast 和 static_cast int x = 65536; (short &)x = 65535; cout<<x; int main() { const int x = 0; *(int*)&x = 2; cout << "x = " << x << endl; // x = 0 (int&)x = 3; int y = x; cout << "y = " << y << endl; // y = 0 const_cast<int&>(x) = 10; y = x; cout << "y = " << y << endl; // y = 0 return 0; } struct T{ int x = 0; const int y = 0; int q() const{ *(int*)&y = y + 1; return y; } }; int main() { T m; const T n; int x = m....