【发布时间】:2020-10-27 07:53:57
【问题描述】:
我有以下代码
在 .hpp 文件中
class A
{
private:
static std::string hello;
}
在 .cpp 文件中
const std::string hello= "hi";
B(hello, strlen(hello)); // where B(const u8_t* a, u8_t b)
我应该使用哪种演员表?
我想最终将 const 字符串转换为 const u8_t * 。
u8_t 是无符号字符
【问题讨论】:
-
hello.c_str()? -
不要使用
u8_t。在<cstdint>中使用uint8_t -
什么是
u8_t?请出示minimal reproducible example -
u8_t = 无符号字符
标签: c++ casting type-conversion