problem
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
Any data is already binary (you could do bitwise operations to extract individual bits). What exactly do you want to achieve?
"Real men drive manual transmission" - Rajesh.
-
As Rajesh said, your computer is a binary device and so all data is stored as binary. Here is some code that displays an 8 bit data as binary. You can extend the same for any other data type.
for (unsigned i = 0; i < 8; ++i)
cout << (datatype & (1 << i)) ? '1' : '0';«_Superman_» _I love work. It gives me something to do between weekends.