J
jose luis fernandez diaz
Hi,
The program below prints a unsigned short in binary base:
#include <iostream>
int main() {
unsigned short mask =0x1;
unsigned short us =0x0071;
mask<<=sizeof(unsigned short)*8-1;
for (int i = 0; i < sizeof(unsigned short)*8; i++)
{
cout << ((us & mask)? 1:0);
us <<= 1;
}
return 0;
}
How can I print the binary base of a long double ?
Thanks,
Jose Luis.
The program below prints a unsigned short in binary base:
#include <iostream>
int main() {
unsigned short mask =0x1;
unsigned short us =0x0071;
mask<<=sizeof(unsigned short)*8-1;
for (int i = 0; i < sizeof(unsigned short)*8; i++)
{
cout << ((us & mask)? 1:0);
us <<= 1;
}
return 0;
}
How can I print the binary base of a long double ?
Thanks,
Jose Luis.