Here is a function that I have written before. It prints a
float
variable in 1's and 0's as it is stored in the memory (it is stored with the IEEE single precision floating point numbers standard).
void printFloat(float a)
{
unsigned long* temp = (unsigned long*)&a;
unsigned long one = 1;
for(int i = 31; i >= 0; i--)
{
if(((*temp) & (one << i)) == 0)
cout << "0";
else cout << "1";
if (i % 4 == 0)
cout << " ";
}
cout << endl;
}
I'm not sure if this is what you need. Hope it helps.