次のコードをコンパイラに書き込んでコンパイルしようとしました。
#include <iostream>
#include <bitset>
using namespace std;
void binary(int a)
{
cout << bitset<8>(a).to_string() << endl;
}
int main()
{
binary(16);
system("pause");
return 0;
}
バイナリ出力が得られるはずですが、エラーが発生し続けます。
In function `void binary(int)':
no matching function for call to `std::bitset<8u>::to_string()'
私はC++が初めてで、これが何を意味するのか本当にわかりません。助けてください。