Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 18th, 2005, 1:19 PM   #1
amin1982
Newbie
 
Join Date: Oct 2004
Posts: 15
Rep Power: 0 amin1982 is on a distinguished road
Post question about BINtoASCII

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...........
amin1982 is offline   Reply With Quote
Old Mar 18th, 2005, 1:35 PM   #2
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 574
Rep Power: 5 Benoit is on a distinguished road
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
Benoit is offline   Reply With Quote
Old Mar 19th, 2005, 5:34 PM   #3
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
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
kurifu is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC