Чтобы преобразовать в массив char, вы можете использовать функцию bitset::to_string()
, чтобы получить строковое представление, а затем скопировать отдельные символы из этой строки:
#include <iostream>
#include <algorithm>
#include <string>
#include <bitset>
int main()
{
std::bitset<8> v8 = 0xcd;
std::string v8_str = v8.to_string();
std::cout << "string form: " << v8_str << '\n';
char a[9] = {0};
std::copy(v8_str.begin(), v8_str.end(), a);
// or even strcpy(a, v8_str.c_str());
std::cout << "array form: " << a << '\n';
}