The main problem I'm having is to read out values in binary in C++ (python had some really quick/easy functions to do this)
I just need the same. So at the moment I have:
ValWord< uint32_t> data1=//[SOME READ FUNCTION]
When I use cout << data1;
It gives me a number e.g 2147581953
I want this to be in binary and eventually each "bit" needs to be in its own bin including all '0's e.g:
for (int i = 31; i >= 0; i--) {
cout << binary[i];
}
Would give me this 32 bit long binary number. When I've had it as a straight forwward int, I've used:
int data[32];
bitset<32>(N) = data1;
for(int i=31; i >=0; i--) {
data[i]=(bitset<32>(N[i]).to_ulong());
}
for (int i = 31; i >= 0; i--) {
cout << data[i];
}
But this just gives me error messages. Any ideas?