![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2004
Posts: 15
Rep Power: 0
![]() |
plz anyone can help in finding a code for converting a sequence of binary to its ascii code
if i want to convert every 8 binary to ascii , and every 16 binary sequence to 2 ascii codes . and write this to a file............... regards........... |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 574
Rep Power: 5
![]() |
Doesn't sound too hard...Break up the binary into groups of 8, then just add together the powers of 2 and output the corresponding ASCII character
What code do you have so far?
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
#3 |
|
Expert Programmer
|
printf actually has a format specifier which will help you with this, I believe the specifier is %x which will allow you do print out hex codes/ascii codes... look it up.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|