我试图实现以下代码,但是我遇到了错误。那是为什么?
#include <iostream>
#include <bitset>
int main()
{
const std::string s = "0010111100011100011";
unsigned long long value = std::bitset<64>(s).to_ullong();
std::cout << value << std::endl;
}
我收到以下错误。
prog.cpp: In function ‘int main()’:
prog.cpp:7: error: ‘class std::bitset<64u>’ has no member named ‘to_ullong’ stdout
答案 0 :(得分:1)
std::bitset::to_ullong
可用。