0
uint8_t* buf1;
...
const signed char* buf2 = static_cast<const signed char*>(buf1);
invalid static_cast from type 'uint8_t* {aka unsigned char*}' to type 'const signed char*'错误:从“无符号字符*”无效转换“常量符号字符*”
C风格的铸造:(常量符号字符*)工作正常
有没有用c任何危险-style-cast vs static_cast在这种情况下?
那么,定义*“危险”*。它*是*合法的。 –
static_cast错误提示这不是安全操作,为什么static_cast失败? –
,因为你需要'reinterpret_cast' –