隐式类型转换是C++一个很不安全的特性,经常给调试程序制造麻烦.
一个避免int和指针间隐式类型转换的技巧是使用const int, 因为没有pointer 到 const int 的implicit cast ,当然经常需要配合使用const_cast<T>()和multiable.
隐式类型转换是C++一个很不安全的特性,经常给调试程序制造麻烦.
一个避免int和指针间隐式类型转换的技巧是使用const int, 因为没有pointer 到 const int 的implicit cast ,当然经常需要配合使用const_cast<T>()和multiable.
转载于:https://www.cnblogs.com/hucn/archive/2011/03/11/1981547.html