Hi,
I am a bioengineer new to C++ (and new to programing in general). I need to create a bit array for an array of integer, where each element of the bit array would be a N-bit representation of each element of the array of integer. My first inclination was to use bitset and utilize the bit manipulation operations it provided, however looks like it is not possible to construct a bitset without explicitly providing the argument, e.g
int a=4;
bitset<8> r1(long(a)); would be an error or at best a warning and a wrong result, why would that be please???
Do any of you have an idea of how I should approach the problem, I mean if bitset is not appropriate what other solution do you propose?
I am a bioengineer new to C++ (and new to programing in general). I need to create a bit array for an array of integer, where each element of the bit array would be a N-bit representation of each element of the array of integer. My first inclination was to use bitset and utilize the bit manipulation operations it provided, however looks like it is not possible to construct a bitset without explicitly providing the argument, e.g
int a=4;
bitset<8> r1(long(a)); would be an error or at best a warning and a wrong result, why would that be please???
Do any of you have an idea of how I should approach the problem, I mean if bitset is not appropriate what other solution do you propose?
Comment