I'm not really sure, but it sort of sounds like you want to do something along this line...
#include <iostream>
#include <bitset>
#include <vector>
#include <algorithm>
int main()
{
static const char init[] = "abcdefghijklmnop...";
std::vector<std::bitset<8> > str(init, init + sizeof init);
std::copy(str.begin(), str.end(),
std::ostream_iterator<std::bitset<8> > (std::cout, "\n"));
return 0;
}
/* my output
01100001
01100010
01100011
01100100
01100101
01100110
01100111
01101000
01101001
01101010
01101011
01101100
01101101
01101110
01101111
01110000
00101110
00101110
00101110
00000000
*/
Which I think is saying that I believe you need to do the bitset differently.
Reputation Points: 2780
Solved Threads: 312
long time no c
Offline 4,790 posts
since Apr 2004