我有一个如下字符串:
std::string strl="ffffffffffffffffffffffffffffffffffffffffffff";
我想将其转换为 uint32_t 变量,如下所示:
uint32_t val = std::stoul(strl, nullptr, 16);
上述操作给出“SIGABRT”信号并给出错误:
terminate called after throwing an instance of 'std::out_of_range'
what(): stoul.
为解决问题需要做哪些更改,或者无法使用 uint32_t 数据类型来存储字符串。