casting

2024/4/23 15:20:04

static_cast 和 reinterpret_cast的区别

static_cast 和 reinterpret_cast的区别 大多程序员在学C前都学过C&#xff0c;并且习惯于C风格&#xff08;类型&#xff09;转换。当写C&#xff08;程序&#xff09;时&#xff0c;有时候我们在使用static_cast<>和reinterpret_cast<>时可能会有点模糊。在本文…

C++进阶:揭密static_cast和reinterpret_cast

介绍 大多程序员在学C前都学过C&#xff0c;并且习惯于C风格&#xff08;类型&#xff09;转换。当写C&#xff08;程序&#xff09;时&#xff0c;有时候我们在使用static_cast<>和 reinterpret_cast<>时可能会有点模糊。在本文中&#xff0c;我将说明static_cast…

批量解决Casting ‘findViewById(R.id.X)‘ to ‘X‘ is redundant

compileSdkVersion >26&#xff0c;findViewById 前的强制类型转换是多余的&#xff0c;AS提供一键清理&#xff1a;