Click to See Complete Forum and Search --> : text to binary


May 19th, 1999, 02:03 PM
I want to change text in a text box to binary. Meaning if I enter "Brad" in a text box and click convert I want "01000010011100100110000101100100" to come up in another text box. (using MFC dialog based program with VC++ 6.0) Thanks.

Br@d

Simon Rose
May 19th, 1999, 04:08 PM
Hey,

Not sure what you mean, but you could step through each character (if it's in a CString) converting each to TCHAR, then UINT. This gives you the number (base 10), then use itoa to convert it to a string base 2 and concatonate each character back together.

This is more a strategy than a solution.

Simon