阅读量:129
是的,C++的stoll函数可以处理十六进制数字。只要在字符串参数前加上"0x"前缀,stoll函数就会将其解释为十六进制数字并转换为对应的十进制数值。例如:
std::string hexStr = "0xFF";
long long decimalValue = std::stoll(hexStr, nullptr, 16);
std::cout << decimalValue class="hljs-comment">// 输出255